コード例 #1
0
 public CollectionByKeyExecutor(TrackCollectionByKey <TKey, TValue> target, CollectionByKeyCommand <TKey, TValue> command)
     : base(target, command)
 {
     if (command.Action == CollectionByKeyChanged.Remove || command.Action == CollectionByKeyChanged.Update)
     {
         OldValue = target[command.Key];
     }
 }
コード例 #2
0
 public static CollectionByKeyExecutor <TKey, TValue> Update(TrackCollectionByKey <TKey, TValue> target, TKey key, TValue newItem)
 {
     return(new CollectionByKeyExecutor <TKey, TValue>(target, new CollectionByKeyCommand <TKey, TValue>(CollectionByKeyChanged.Update, key, newItem)));
 }
コード例 #3
0
 public static CollectionByKeyExecutor <TKey, TValue> Remove(TrackCollectionByKey <TKey, TValue> target, TKey key)
 {
     return(new CollectionByKeyExecutor <TKey, TValue>(target, new CollectionByKeyCommand <TKey, TValue>(CollectionByKeyChanged.Remove, key, default)));
 }
コード例 #4
0
 public static CollectionByKeyExecutor <TKey, TValue> Insert(TrackCollectionByKey <TKey, TValue> target, TKey key, TValue newValue)
 {
     return(new CollectionByKeyExecutor <TKey, TValue>(target, new CollectionByKeyCommand <TKey, TValue>(CollectionByKeyChanged.Insert, key, newValue)));
 }