示例#1
0
 public CollectionByKeyExecutor(CommandedCollectionByKey <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> Remove(CommandedCollectionByKey <TKey, TValue> target, TKey key)
 {
     return(new CollectionByKeyExecutor <TKey, TValue>(target, new CollectionByKeyCommand <TKey, TValue>(CollectionByKeyChanged.Remove, key, default !)));
示例#3
0
 public static CollectionByKeyExecutor <TKey, TValue> Insert(CommandedCollectionByKey <TKey, TValue> target, TKey key, TValue newValue)
 {
     return(new CollectionByKeyExecutor <TKey, TValue>(target, new CollectionByKeyCommand <TKey, TValue>(CollectionByKeyChanged.Insert, key, newValue)));
 }