wasSharp – Diff between revs 44 and 54
?pathlinks?
Rev 44 | Rev 54 | |||
---|---|---|---|---|
Line 51... | Line 51... | |||
51 | { |
51 | { |
|
52 | if (_lock.IsWriteLockHeld) _lock.ExitWriteLock(); |
52 | if (_lock.IsWriteLockHeld) _lock.ExitWriteLock(); |
|
53 | } |
53 | } |
|
54 | } |
54 | } |
|
Line 55... | Line 55... | |||
55 | |
55 | |
|
56 | public int Count |
56 | public bool IsReadOnly |
|
57 | { |
57 | { |
|
58 | get |
58 | get |
|
59 | { |
59 | { |
|
60 | _lock.EnterReadLock(); |
60 | _lock.EnterReadLock(); |
|
61 | try |
61 | try |
|
62 | { |
62 | { |
|
63 | return _list.Count; |
63 | return ((IList<T>)_list).IsReadOnly; |
|
64 | } |
64 | } |
|
65 | finally |
65 | finally |
|
66 | { |
66 | { |
|
67 | if (_lock.IsReadLockHeld) _lock.ExitReadLock(); |
67 | if (_lock.IsReadLockHeld) _lock.ExitReadLock(); |
|
68 | } |
- | ||
69 | |
68 | } |
|
70 | } |
69 | } |
|
71 | } |
70 | } |
|
72 | |
71 | |
|
73 | public bool IsReadOnly |
72 | int ICollection<T>.Count |
|
74 | { |
73 | { |
|
75 | get |
74 | get |
|
76 | { |
75 | { |
|
77 | _lock.EnterReadLock(); |
76 | _lock.EnterReadLock(); |
|
78 | try |
77 | try |
|
79 | { |
78 | { |
|
80 | return ((IList<T>)_list).IsReadOnly; |
79 | return _list.Count; |
|
81 | } |
80 | } |
|
82 | finally |
81 | finally |
|
83 | { |
82 | { |
|
84 | if (_lock.IsReadLockHeld) _lock.ExitReadLock(); |
83 | if (_lock.IsReadLockHeld) _lock.ExitReadLock(); |
|
85 | } |
84 | } |
|
86 | } |
85 | } |
|
87 | } |
86 | } |
|
88 | |
87 | |
|
89 | public T this[int index] |
88 | public T this[int index] |
|
90 | { |
89 | { |
|
91 | get |
90 | get |
|
92 | { |
91 | { |