Beispiel #1
0
        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));
            }
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #3
0
        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;
 }
Beispiel #6
0
 public ChangedEventArgs(T item, ChangedAction action)
 {
     Item   = item;
     Action = action;
 }
Beispiel #7
0
 public CollectionChangedEvent(int index, T value, ChangedAction action)
 {
     Index       = index;
     Value       = value;
     this.Action = action;
 }
Beispiel #8
0
 public DictionaryChangedEventArgs(KeyValuePair <K, V> item, ChangedAction action)
 {
     Item   = item;
     Action = action;
 }