Пример #1
0
        protected override void CloseSession()
        {
            StatProvider.SetNewState(SyncStates.ClosingSession);

            // TODO Should be manage by client sync not by SyncMode
            if (SyncType != SyncTypes.OneWay)
            {
                SyncSession.HasSuccess = true;
                var syncSessionRepo = new SyncSessionInfoRepository(DataStore);
                syncSessionRepo.Save(SyncSession);
            }

            Transport.Send <bool>(true);
        }
Пример #2
0
        private void SyncServerChange()
        {
            if (SyncType == SyncTypes.OneWay)
            {
                return;
            }

            Conflicts.RemoveInvolve(LocalEntitiesChangeset);

            StatProvider.SetNewState(SyncStates.SendingServerChange, Transport);
            Transport.Send(LocalEntitiesChangeset);

            StatProvider.SetNewState(SyncStates.SendingConflictsSolved, Transport);
            Transport.Send(Conflicts);
        }
Пример #3
0
 private void Work()
 {
     try
     {
         InitSync();
         Conflicts = SyncRemoteChange();
         DetermineTypeOfSync();
         SyncServerChange();
         FinalizeSync();
     }
     catch (Exception ex)
     {
         ErrorOccurs = true;
         Logger.Error(ex);
         StatProvider.SetNewState(SyncStates.InError);
     }
     finally
     {
         IsSyncInProgress = false;
     }
 }
Пример #4
0
 protected virtual void EstablishNewSession()
 {
     StatProvider.SetNewState(SyncStates.EstablishNewSession);
 }
Пример #5
0
 protected virtual void DetermineTypeOfSync()
 {
     StatProvider.SetNewState(SyncStates.DetermineTypeOfSync);
 }
Пример #6
0
 protected override void CleanEntities()
 {
     StatProvider.SetNewState(SyncStates.CleanEntites);
     CleanEntities(DataStore, SyncSession.HighBoundaryAnchor);
 }