示例#1
0
        protected override void SynchronizeImpl()
        {
            ISerializableObject source = StateOwner.SourceObject;
            ISerializableObject sink   = StateOwner.SinkObject;


            CopyUtils.ForeignKeyCopy(StateOwner.SinkSerializer, KeyCarrier, sink, base._fieldLock);

            //Kopiere die angepassten Daten...
            CopyUtils.PlainCopy(StateOwner.SinkSerializer, _resolved, sink, base._fieldLock, false);
            CopyUtils.PlainCopy(StateOwner.SourceSerializer, _resolved, source, base._fieldLock, false);

            StateOwner.SinkSerializer.Connector.UpdatePlain(sink);
            StateOwner.SourceSerializer.Connector.UpdatePlain(source);


            _sourceSyncItem.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SourceSerializer.Target, source);
            StateOwner.SyncSerializer.Connector.Save(_sourceSyncItem);
            SyncItem tmp = _sourceSyncItem.CounterPart;

            tmp.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SinkSerializer.Target, sink);
            StateOwner.SyncSerializer.Connector.Save(tmp);

            StateOwner.UpdateFieldStates(StateOwner.SourceSerializer.Target, _sourceSyncItem, source);
            StateOwner.UpdateFieldStates(StateOwner.SinkSerializer.Target, tmp, sink);
        }
示例#2
0
        protected override void SynchronizeImpl()
        {
            ISerializableObject source = StateOwner.SourceObject;
            ISerializableObject sink   = StateOwner.SinkSerializer.CreateISerializableObject(StateOwner.SynchronizedType);

            CopyUtils.PlainCopy(StateOwner.SinkSerializer, KeyCarrier, sink, new FieldLock(source.GetType()), true);
            CopyUtils.PlainCopy(StateOwner.SinkSerializer, source, sink, new FieldLock(source.GetType()), false);

            StateOwner.SinkSerializer.Connector.InsertPlain(sink);
            StateOwner.SinkObject = sink;

            SyncItem si1 = StateOwner.SyncSerializer.CreateISerializableObject <SyncItem>();
            SyncItem si2 = StateOwner.SyncSerializer.CreateISerializableObject <SyncItem>();

            si1.SyncGuid = AttributeWorker.RowGuid(source);
            si2.SyncGuid = AttributeWorker.RowGuid(sink);
            si1.ClassID  = source.GetType().Name;
            si2.ClassID  = source.GetType().Name;

            si1.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SourceSerializer.Target, source);
            si2.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SinkSerializer.Target, sink);

            si1.CounterPart = si2;

            StateOwner.SyncSerializer.Connector.Save(si1);
            StateOwner.SyncSerializer.ConnectOneToOne(si1, si2);
            StateOwner.SyncSerializer.Connector.Save(si2);
            StateOwner.SyncSerializer.ConnectOneToOne(si2, si1);
            StateOwner.SyncSerializer.Connector.Save(si1);

            StateOwner.UpdateFieldStates(StateOwner.SourceSerializer.Target, si1, source);//Deaktiviert
            StateOwner.UpdateFieldStates(StateOwner.SinkSerializer.Target, si2, sink);
        }
示例#3
0
        protected override void SynchronizeImpl()
        {
            ISerializableObject source = StateOwner.SourceObject;
            ISerializableObject sink   = StateOwner.SinkObject;

            CopyUtils.PlainCopy(StateOwner.SinkSerializer, KeyCarrier, sink, _fieldLock, true);
            CopyUtils.PlainCopy(StateOwner.SinkSerializer, source, sink, _fieldLock, false);

            StateOwner.SinkSerializer.Connector.UpdatePlain(sink);

            _sourceSyncItem.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SourceSerializer.Target, source);
            StateOwner.SyncSerializer.Connector.Save(_sourceSyncItem);
            SyncItem sinkSyncItem = _sourceSyncItem.CounterPart;

            sinkSyncItem.Hashcode = SyncContainer.ComputeHashCode(StateOwner.SinkSerializer.Target, sink);
            StateOwner.SyncSerializer.Connector.Save(sinkSyncItem);

            StateOwner.UpdateFieldStates(StateOwner.SourceSerializer.Target, _sourceSyncItem, source);
            StateOwner.UpdateFieldStates(StateOwner.SinkSerializer.Target, sinkSyncItem, sink);
        }