public void ApplyResolution(ISqlDataStore datastore, ISyncSessionInfo syncSessionInfo) { foreach (var mergeResolution in MergeResolutionToApplies) { mergeResolution.ApplyResolution(datastore, syncSessionInfo); } }
public SolvableEntityConflict(IEntityInfo entityInfo, ISyncSessionInfo syncSessionInfo) : this() { _entityInfo = entityInfo; _syncSessionInfo = syncSessionInfo; EntityName = entityInfo.GetNameInStore(); }
public Conflict(IEntityInfo entityInfo, EntityChange local, EntityChange remote, ISyncSessionInfo syncSessionInfo) { _entityInfo = entityInfo; _local = local; _remote = remote; _syncSessionInfo = syncSessionInfo; }
public IEntityConflict CreateEntityConflict(EntityChangeset entityChangeset, ISyncSessionInfo syncSessionInfo) { var entityInfo = entityChangeset.GetSyncableEntity(); var entityConflict = new SolvableEntityConflict(entityInfo, syncSessionInfo); EntitiesConflict.Add(entityConflict); return(entityConflict); }
public void SetSyncSession(ISyncSessionInfo syncSessionInfo) { _syncSessionInfo = syncSessionInfo; foreach (var entityChangeset in EntityChangeset) { entityChangeset.SetSyncSession(syncSessionInfo); } }
public void ApplyRemoteResolution(ISqlDataStore datastore, ISyncSessionInfo syncSessionInfo) { if (RemoteMergeResolution == null) { return; } RemoteMergeResolution.ApplyResolution(datastore, syncSessionInfo); }
public bool HasChangedInSession(string trackColName, ISyncSessionInfo syncSession) { var trackField = GetField(trackColName); if (trackField == null) { return(false); } return(trackField.HasChangedInSession(syncSession)); }
public bool IsIncludeInSyncSession(ISyncSessionInfo syncSession) { if (Value == null || Value == DBNull.Value) { return(false); } var lastUpdate = (DateTime)Value; return(lastUpdate > syncSession.LowBoundaryAnchor && lastUpdate <= syncSession.HighBoundaryAnchor); }
public static void InsertInLocal(IDataStore localDataStore, ISyncSessionInfo syncSessionInfo, ISyncable remoteEntity) { var entityInfo = localDataStore.GetEntityInfo(remoteEntity); var mergeResolution = new MergeResolution { OperationType = OperationTypes.Insert, Entity = EntityChange.Create(entityInfo, remoteEntity) }; mergeResolution.ApplyResolution(localDataStore as ISqlDataStore, syncSessionInfo); }
public void ApplyRemoteResolution(ISqlDataStore dataStore, ISyncSessionInfo syncSession, ISyncStatProvider statProvider) { if (EntitiesConflict == null || EntitiesConflict.Count == 0) { return; } var progression = new LinearProgression(EntitiesConflict.Count); statProvider.SetNewState(SyncStates.ApplyRemoteResolution, progression); foreach (var entityConflict in EntitiesConflict) { entityConflict.ApplyRemoteResolution(dataStore, syncSession); progression.CurrentStepFinished(); } }
public void ApplyRemoteResolution(ISqlDataStore dataStore, ISyncSessionInfo syncSessionInfo) { if (Conflicts == null || Conflicts.Count == 0) { return; } foreach (var conflict in Conflicts) { conflict.ApplyRemotePreResolution(dataStore, syncSessionInfo); } foreach (var conflict in Conflicts) { conflict.ApplyRemoteResolution(dataStore, syncSessionInfo); } }
public void ApplyResolution(ISqlDataStore datastore, ISyncSessionInfo syncSessionInfo) { var entityInfo = datastore.Entities[Entity.EntityName]; var entityChangesetBuilder = new EntityChangesetBuilder(entityInfo, syncSessionInfo); switch (OperationType) { case OperationTypes.Insert: Entity.ApplyInsert(datastore, entityChangesetBuilder); break; case OperationTypes.Update: Entity.ApplyUpdate(datastore, entityChangesetBuilder); break; case OperationTypes.Delete: Entity.ApplyDelete(datastore, Entity.EntityName, entityChangesetBuilder); break; } }
public EntitiesChangeset(ISqlDataStore dataStore, ISyncSessionInfo syncSessionInfo) { _dataStore = dataStore; EntityChangeset = new List <EntityChangeset>(); SetSyncSession(syncSessionInfo); }
protected SyncQuery(IDataStore datastore, ISyncableEntity entity, ISyncSessionInfo syncSession) { _datastore = datastore; _syncSession = syncSession; Entity = entity; }
public EntityChangesetBuilder(IEntityInfo entityInfo, ISyncSessionInfo syncSessionInfo) { _entityInfo = entityInfo; _syncSessionInfo = syncSessionInfo; }
public ClientEntitiesChangeset(ISqlDataStore dataStore, ISyncSessionInfo syncSessionInfo) : base(dataStore, syncSessionInfo) { }
public IEntityConflict CreateEntityConflict(EntityChangeset entityChangeset, ISyncSessionInfo syncSessionInfo) { return(new IgnoreAllEntityConflict()); }
public void SetSyncSession(ISyncSessionInfo syncSessionInfo) { _syncSession = syncSessionInfo; }
public static EntityChangeset Create(ISqlDataStore dataStore, IEntityInfo syncEntity, ISyncSessionInfo syncSessionInfo) { var entityName = syncEntity.GetNameInStore(); var result = new EntityChangeset(entityName) { _syncSession = syncSessionInfo }; result.SetDatastore(dataStore); return(result); }
public DeleteSyncQuery(IDataStore datastore, ISyncableEntity entity, ISyncSessionInfo syncSession) : base(datastore, entity.EntityTombstoneInfo, syncSession) { }
public UpdateSyncQuery(IDataStore datastore, ISyncableEntity entity, ISyncSessionInfo syncSession) : base(datastore, entity, syncSession) { }
public bool HasChangedInSession(ISyncSessionInfo syncSession) { return(FieldValue.IsIncludeInSyncSession(syncSession)); }