public TValue this[TKey key] { get { return(_dictionary[key]); } set { ChangedAction action = ContainsKey(key) ? ChangedAction.Update : ChangedAction.Add; _dictionary[key] = value; OnChanged(new ChangedEventArgs <KeyValuePair <TKey, TValue> >(new KeyValuePair <TKey, TValue>(key, value), action)); } }
public override void Process(Player player, object value) { int previous = SelectedIndex; base.Process(player, value); if (SelectedIndex != previous) { PropInfo.SetValue(Target, Enum.ToObject(typeof(TEnumType), (int)SelectedIndex), null); ChangedAction?.Invoke(); } }
internal CollectionReceivedEventArgs(ChangedAction action, IEnumerable <T> data) { Action = action.ToClientValue(); var ary = data.ToArray(); #if NETSTANDARD1_5 Data = ary; #else Data = Array.AsReadOnly(ary); #endif }
public static NotifyCollectionChangedAction ToClientValue(this ChangedAction v) { switch (v) { case ChangedAction.Add: return(NotifyCollectionChangedAction.Add); case ChangedAction.Remove: return(NotifyCollectionChangedAction.Remove); case ChangedAction.Replace: return(NotifyCollectionChangedAction.Replace); case ChangedAction.Reset: default: return(NotifyCollectionChangedAction.Reset); } }
public DataItemEventArgs(T item, ChangedAction changedAction) { this.item = item; this.changedAction = changedAction; }
public ChangedEventArgs(T item, ChangedAction action) { Item = item; Action = action; }
public CollectionChangedEvent(int index, T value, ChangedAction action) { Index = index; Value = value; this.Action = action; }
public DictionaryChangedEventArgs(KeyValuePair <K, V> item, ChangedAction action) { Item = item; Action = action; }