/// <summary> /// Sets the sync error to null. This method is not thread safe. /// </summary> internal void UnsafeClearSyncError() { syncConflict = null; OnPropertyChanged("SyncConflict"); OnPropertyChanged("HasSyncConflict"); }
/// <summary> /// Clears the sync conflict and removes it from the conflict list on the c. /// </summary> public async Task ClearSyncConflict() { if (syncConflict != null) { await context.ClearSyncConflict(syncConflict); syncConflict = null; OnPropertyChanged("SyncConflict"); OnPropertyChanged("HasSyncConflict"); } }
/// <summary> /// Sets the sync conflict, providing the cache data so that the conflict can be removed if ClearSyncConflict /// is called. /// </summary> ///<param name="c">IsolatedStorageOfflineContext</param> /// <param name="sc">conflict to set.</param> internal void SetSyncConflict(WinEightContext c, SyncConflict sc) { SyncConflict oldConflict = this.syncConflict; this.context = c; this.syncConflict = sc; OnPropertyChanged("SyncConflict"); if (oldConflict == null) { OnPropertyChanged("HasSyncConflict"); } }
public WinEightSyncConflict(SyncConflict conflict) { this.LiveEntity = conflict.LiveEntity; this.LosingEntity = conflict.LosingEntity; this.Resolution = conflict.Resolution; }
public abstract SyncConflict MapSyncConflict(OfflineEntity entity, SyncConflict conflict, WinEightContext context);
private async void ClearSyncConflict(SyncConflict syncConflict, WinEightContext context) { RemoveSyncConflict(syncConflict); await context.ClearSyncConflict(syncConflict); }
/// <summary> /// Removes the specified sync conflict /// </summary> /// <param name="conflict">Conflict to remove</param> public void RemoveSyncConflict(SyncConflict conflict) { SyncConflicts.Remove(conflict); }
public void AddSerializedConflict(SyncConflict conflict, WinEightContext context) { Type entityType = conflict.LiveEntity.GetType(); OfflineEntity entity = Collections[entityType].AddOrUpdateSyncEntity((OfflineEntity)conflict.LiveEntity); SyncConflict oldConflict = (SyncConflict)Collections[entityType].MapSyncConflict(entity, conflict, context); SyncConflicts.Add(conflict); if (oldConflict != null) ClearSyncConflict(oldConflict, context); }