Example #1
0
 public ScopedMap(IMap <TKey, TValue> map, IScope scope, string identifier, ISerializer <TKey> keySerializer)
 {
     if (scope == null)
     {
         throw new ArgumentNullException(nameof(scope));
     }
     if (identifier == null)
     {
         throw new ArgumentNullException(nameof(identifier));
     }
     if (!(scope is MapScope))
     {
         throw new ArgumentException("The provided scope type is incompatible", nameof(scope));
     }
     if (map == null)
     {
         throw new ArgumentNullException(nameof(map));
     }
     if (keySerializer == null)
     {
         throw new ArgumentNullException(nameof(keySerializer));
     }
     Map        = map;
     Scope      = (MapScope)scope;
     Identifier = identifier;
     Scope.Register(this);
     KeySerializer = keySerializer;
 }
Example #2
0
 public ScopedSetMap(ISetMap <TKey, TItem> map, IScope scope, string identifier, ISerializer <TKey> keySerializer, bool removeOnEmptySet = false)
     : base(map, scope, identifier, keySerializer)
 {
     _scope            = (MapScope)scope;
     _keySerializer    = keySerializer;
     _removeOnEmptySet = removeOnEmptySet;
 }
Example #3
0
 public SetWrapper(TKey key, ISet <TItem> set, MapScope scope, string identifier, ISerializer <TKey> keySerializer)
 {
     _key           = key;
     _set           = set;
     _scope         = scope;
     _identifier    = identifier;
     _keySerializer = keySerializer;
 }