public T RemoveAt(int i) { T val; if (Set.TryRemove(i, out val)) { DataStreamChanged.Invoke(this, new NotifyDataStreamChangedEventArgs <T>(i, NotifyCollectionChangedAction.Remove, val, default(T)));//this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new KeyValuePair<int, T>(i, val))); return(val); } return(default(T)); }
public T this[int i] { get { return(Set[i]); } set { if (!Set.ContainsKey(i)) { Set[i] = value; DataStreamChanged.Invoke(this, new NotifyDataStreamChangedEventArgs <T>(i, NotifyCollectionChangedAction.Add, default(T), value));//this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, new KeyValuePair<int, T>(i, value))); } else if (!EqualityComparer <T> .Default.Equals(Set[i], value)) { Set[i] = value; DataStreamChanged.Invoke(this, new NotifyDataStreamChangedEventArgs <T>(i, NotifyCollectionChangedAction.Replace, default(T), value));//(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace, new KeyValuePair<int, T>(i, value))); } } }
private void DataStream_EntityChanged(IDataStream <Key> sender, DSChangedArgs <Key, T> args) { DataStreamChanged.Invoke(this, args); }
public void Clear() { Set.Clear(); DataStreamChanged.Invoke(this, new NotifyDataStreamChangedEventArgs <T>(-1, NotifyCollectionChangedAction.Reset, default(T), default(T))); //this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); }