コード例 #1
0
 public ObservableDictionarySyncSource(SyncSourceRoot syncSourceRoot, int referenceId,
                                       ObservableDictionary <TKey, TValue> baseObject,
                                       IFieldSerializerResolver fieldSerializerResolver) : base(syncSourceRoot, referenceId, baseObject)
 {
     _keySerializer                = fieldSerializerResolver.FindMatchingSerializer(typeof(TKey));
     _valueSerializer              = fieldSerializerResolver.FindMatchingSerializer(typeof(TValue));
     BaseObject.CollectionChanged += OnCollectionChanged;
     AddNewItemReferences(BaseObject.ToList());
 }
コード例 #2
0
        public ObservableDictionarySyncTarget(int referenceId, Type baseType, ExtendedBinaryReader reader,
                                              SyncTargetRoot syncTargetRoot, IFieldSerializerResolver fieldDeserializerResolver) : base(referenceId)
        {
            _syncTargetRoot = syncTargetRoot;
            _clock          = _syncTargetRoot.Clock;

            base.BaseObject = Activator.CreateInstance(baseType);
            BaseObject.CollectionChanged += OnCollectionChanged;

            _keySerializer   = fieldDeserializerResolver.FindMatchingSerializer(typeof(TKey));
            _valueSerializer = fieldDeserializerResolver.FindMatchingSerializer(typeof(TValue));

            _syncTargetRoot.EndRead += EndRead;
            Read(reader);
        }