// Token: 0x060017A3 RID: 6051 RVA: 0x0008C504 File Offset: 0x0008A704
        public static ISyncStatusData Load(SyncStateStorage syncStateStorage)
        {
            SyncStatusData  syncStatusData = null;
            bool            flag           = false;
            ISyncStatusData result;

            try
            {
                syncStatusData = new SyncStatusData();
                syncStatusData.syncStatusSyncState = AirSyncUtility.GetOrCreateSyncStatusSyncState(syncStateStorage);
                syncStatusData.clientCategoryList  = syncStatusData.GetClientCategoryList();
                syncStatusData.lastClientIdsSent   = syncStatusData.GetLastIdsSeen();
                syncStatusData.dirty = false;
                syncStatusData.clientCategoryListModified = false;
                syncStatusData.lastClientIdsSentModified  = false;
                flag   = true;
                result = syncStatusData;
            }
            finally
            {
                if (!flag && syncStatusData != null)
                {
                    syncStatusData.Dispose();
                    syncStatusData = null;
                }
            }
            return(result);
        }
Exemplo n.º 2
0
        public static ISyncStatusData Load(GlobalInfo globalInfo, SyncStateStorage syncStateStorage)
        {
            NewSyncStatusData newSyncStatusData = new NewSyncStatusData();

            newSyncStatusData.globalInfo     = globalInfo;
            newSyncStatusData.deviceMetadata = syncStateStorage.DeviceMetadata;
            if (!globalInfo.HasNewSyncData)
            {
                using (SyncStatusData syncStatusData = SyncStatusData.Load(syncStateStorage) as SyncStatusData)
                {
                    newSyncStatusData.clientCategoryList           = ((syncStatusData.ClientCategoryList == null) ? null : new List <int>(syncStatusData.ClientCategoryList));
                    newSyncStatusData.lastClientIdsSent            = ((syncStatusData.LastClientIdsSeen == null) ? null : new List <string>(syncStatusData.LastClientIdsSeen));
                    newSyncStatusData.lastSyncRequestRandomString  = syncStatusData.LastSyncRequestRandomString;
                    newSyncStatusData.lastCachableWbxmlDocument    = syncStatusData.LastCachableWbxmlDocument;
                    newSyncStatusData.ClientCanSendUpEmptyRequests = syncStatusData.ClientCanSendUpEmptyRequests;
                    newSyncStatusData.lastSyncAttemptTime          = syncStatusData.LastSyncAttemptTime;
                    newSyncStatusData.lastSyncSuccessTime          = syncStatusData.LastSyncSuccessTime;
                    newSyncStatusData.lastSyncUserAgent            = syncStatusData.LastSyncUserAgent;
                }
                newSyncStatusData.deviceMetadataStateChanged = true;
                newSyncStatusData.globalStateModified        = NewSyncStatusData.GlobalInfoStateModified.All;
            }
            else
            {
                newSyncStatusData.clientCategoryList           = ((globalInfo.ClientCategoryHashList == null) ? null : new List <int>(globalInfo.ClientCategoryHashList));
                newSyncStatusData.lastClientIdsSent            = ((globalInfo.LastClientIdsSeen == null) ? null : new List <string>(globalInfo.LastClientIdsSeen));
                newSyncStatusData.lastSyncRequestRandomString  = newSyncStatusData.deviceMetadata.LastSyncRequestRandomString;
                newSyncStatusData.lastCachableWbxmlDocument    = newSyncStatusData.deviceMetadata.LastCachedSyncRequest;
                newSyncStatusData.ClientCanSendUpEmptyRequests = newSyncStatusData.deviceMetadata.ClientCanSendUpEmptyRequests;
                newSyncStatusData.lastSyncAttemptTime          = globalInfo.LastSyncAttemptTime;
                newSyncStatusData.lastSyncSuccessTime          = globalInfo.LastSyncSuccessTime;
                newSyncStatusData.lastSyncUserAgent            = globalInfo.LastSyncUserAgent;
                newSyncStatusData.deviceMetadataStateChanged   = false;
                newSyncStatusData.globalStateModified          = NewSyncStatusData.GlobalInfoStateModified.None;
            }
            return(newSyncStatusData);
        }