wasSharp – Diff between revs 10 and 23
?pathlinks?
Rev 10 | Rev 23 | |||
---|---|---|---|---|
Line 17... | Line 17... | |||
17 | /////////////////////////////////////////////////////////////////////////// |
17 | /////////////////////////////////////////////////////////////////////////// |
|
18 | /// <summary> |
18 | /// <summary> |
|
19 | /// An implementation of an observable HashSet. |
19 | /// An implementation of an observable HashSet. |
|
20 | /// </summary> |
20 | /// </summary> |
|
21 | /// <typeparam name="T">the object type</typeparam> |
21 | /// <typeparam name="T">the object type</typeparam> |
|
22 | public class ObservableHashSet<T> : ICollection<T>, INotifyCollectionChanged |
22 | public class ObservableHashSet<T> : ICollection<T>, INotifyCollectionChanged, IEnumerable<T> |
|
23 | { |
23 | { |
|
24 | private readonly HashSet<T> store = new HashSet<T>(); |
24 | private readonly HashSet<T> store = new HashSet<T>(); |
|
Line 25... | Line 25... | |||
25 | |
25 | |
|
26 | public ObservableHashSet(HashSet<T> set) |
26 | public ObservableHashSet(HashSet<T> set) |
|
Line 130... | Line 130... | |||
130 | if (!IsVirgin && removed.Any()) |
130 | if (!IsVirgin && removed.Any()) |
|
131 | OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, |
131 | OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, |
|
132 | removed)); |
132 | removed)); |
|
133 | IsVirgin = false; |
133 | IsVirgin = false; |
|
134 | } |
134 | } |
|
- | 135 | |
||
- | 136 | public IEnumerable<T> AsEnumerable() |
||
- | 137 | { |
||
- | 138 | return store.AsEnumerable(); |
||
- | 139 | } |
||
135 | } |
140 | } |
|
136 | } |
141 | } |
|
137 | |
142 | |