Пример #1
0
        /// <summary>
        ///  Sets the sync error to null. This method is not thread safe.
        /// </summary>
        internal void UnsafeClearSyncError()
        {
            syncConflict = null;

            OnPropertyChanged("SyncConflict");
            OnPropertyChanged("HasSyncConflict");
        }
Пример #2
0
        /// <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");
            }
        }
Пример #3
0
        /// <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");
            }
        }
Пример #4
0
 public WinEightSyncConflict(SyncConflict conflict)
 {
     this.LiveEntity = conflict.LiveEntity;
     this.LosingEntity = conflict.LosingEntity;
     this.Resolution = conflict.Resolution;
 }
Пример #5
0
 public abstract SyncConflict MapSyncConflict(OfflineEntity entity, SyncConflict conflict,
                                              WinEightContext context);
Пример #6
0
 private async void ClearSyncConflict(SyncConflict syncConflict, WinEightContext context)
 {
     RemoveSyncConflict(syncConflict);
     await context.ClearSyncConflict(syncConflict);
 }
Пример #7
0
 /// <summary>
 /// Removes the specified sync conflict
 /// </summary>
 /// <param name="conflict">Conflict to remove</param>
 public void RemoveSyncConflict(SyncConflict conflict)
 {
     SyncConflicts.Remove(conflict);
 }
Пример #8
0
        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);
        }