// Token: 0x060008FE RID: 2302 RVA: 0x00035AF4 File Offset: 0x00033CF4
        private static void ConvertV7StickyOptions(FolderSyncState syncState)
        {
            XmlNode       xmlNode       = null;
            ByteArrayData byteArrayData = (ByteArrayData)syncState[CustomStateDatumType.CachedOptionsNode];

            if (byteArrayData == null || byteArrayData.Data == null)
            {
                return;
            }
            using (MemoryStream memoryStream = new MemoryStream(byteArrayData.Data))
            {
                using (WbxmlReader wbxmlReader = new WbxmlReader(memoryStream))
                {
                    xmlNode = wbxmlReader.ReadXmlDocument().FirstChild;
                    if (xmlNode == null)
                    {
                        return;
                    }
                }
            }
            using (MemoryStream memoryStream2 = new MemoryStream(50))
            {
                WbxmlWriter wbxmlWriter = new WbxmlWriter(memoryStream2);
                XmlElement  xmlElement  = xmlNode.OwnerDocument.CreateElement("Collection", "AirSync:");
                xmlElement.AppendChild(xmlNode);
                wbxmlWriter.WriteXmlDocumentFromElement(xmlElement);
                syncState[CustomStateDatumType.CachedOptionsNode] = new ByteArrayData(memoryStream2.ToArray());
            }
        }
Esempio n. 2
0
 public Folder(string folderId, string path, FolderSyncState syncState, FolderIgnores ignores)
 {
     this.FolderId     = folderId;
     this.Path         = path;
     this.SyncState    = syncState;
     this.syncingPaths = new HashSet <string>();
     this._ignores     = ignores;
 }
 internal DateTimeCustomSyncFilter(FolderSyncState syncState)
 {
     if (syncState == null)
     {
         throw new ArgumentNullException("syncState");
     }
     this.syncState = syncState;
 }
Esempio n. 4
0
 public Folder(string folderId, string path, FolderSyncState syncState, FolderIgnores ignores)
 {
     this.FolderId = folderId;
     this.Path = path;
     this.SyncState = syncState;
     this.syncingPaths = new HashSet<string>();
     this._ignores = ignores;
 }
        private void OnSyncStateChanged(string folderId, FolderSyncState oldState, FolderSyncState syncState)
        {
            var handler = this.SyncStateChanged;

            if (handler != null)
            {
                handler(this, new SyncStateChangedEventArgs(folderId, oldState, syncState));
            }
        }
Esempio n. 6
0
 public Folder(string folderId, string path, FolderSyncState syncState, FolderStatus status)
 {
     this.FolderId     = folderId;
     this.Path         = path;
     this.SyncState    = syncState;
     this.syncingPaths = new HashSet <string>();
     this._status      = status;
     this.FolderErrors = new List <FolderError>().AsReadOnly();
 }
Esempio n. 7
0
 public Folder(string folderId, string label, string path, FolderSyncState syncState, FolderStatus status)
 {
     this.FolderId     = folderId;
     this.Label        = String.IsNullOrWhiteSpace(label) ? folderId : label;
     this.Path         = path;
     this.SyncState    = syncState;
     this.syncingPaths = new HashSet <string>();
     this._status      = status;
     this.FolderErrors = new List <FolderError>().AsReadOnly();
 }
        // Token: 0x06000C3C RID: 3132 RVA: 0x00040194 File Offset: 0x0003E394
        protected override int InternalExecute(int count)
        {
            FolderSyncState folderSyncState = null;
            int             result;

            try
            {
                string        text          = HttpUtility.UrlDecode(base.FileReference);
                int           num           = text.IndexOf(':');
                ItemIdMapping itemIdMapping = null;
                if (num != -1 && num != text.LastIndexOf(':'))
                {
                    string text2 = text.Substring(0, num);
                    SyncCollection.CollectionTypes collectionType = AirSyncUtility.GetCollectionType(text2);
                    if (collectionType != SyncCollection.CollectionTypes.Mailbox && collectionType != SyncCollection.CollectionTypes.Unknown)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "NoAttachmentsOnVItem");
                        AirSyncPermanentException ex = new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidCombinationOfIDs, null, false);
                        throw ex;
                    }
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(new MailboxSyncProviderFactory(base.Session), text2);
                    if (folderSyncState == null)
                    {
                        throw new ObjectNotFoundException(ServerStrings.MapiCannotOpenAttachmentId(text));
                    }
                    itemIdMapping = (ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping];
                    if (itemIdMapping == null)
                    {
                        throw new ObjectNotFoundException(ServerStrings.MapiCannotOpenAttachmentId(text));
                    }
                }
                int num2;
                base.ContentType = AttachmentHelper.GetAttachment(base.Session, text, base.OutStream, base.MinRange, count, base.MaxAttachmentSize, itemIdMapping, base.RightsManagementSupport, out num2);
                result           = num2;
            }
            finally
            {
                if (folderSyncState != null)
                {
                    folderSyncState.Dispose();
                    folderSyncState = null;
                }
            }
            return(result);
        }
Esempio n. 9
0
        private void ExecuteApplicationStart(object sender, EventArgs e)
        {
            int num = 0;

            num = Privileges.RemoveAllExcept(new string[]
            {
                "SeAuditPrivilege",
                "SeChangeNotifyPrivilege",
                "SeCreateGlobalPrivilege",
                "SeImpersonatePrivilege",
                "SeIncreaseQuotaPrivilege",
                "SeAssignPrimaryTokenPrivilege",
                "SeTcbPrivilege"
            }, "MSExchangeServicesSyncPool");
            if (num != 0)
            {
                string name;
                using (WindowsIdentity current = WindowsIdentity.GetCurrent())
                {
                    name = current.Name;
                }
                AirSyncDiagnostics.LogPeriodicEvent(AirSyncEventLogConstants.Tuple_SetPrivilegesFailure, "SetPrivilegesFailure: " + name, new string[]
                {
                    name,
                    num.ToString(CultureInfo.InvariantCulture)
                });
                Environment.Exit(num);
            }
            ExWatson.Init("E12");
            AppDomain.CurrentDomain.UnhandledException += Global.HandledExceptionProxy;
            Globals.InitializeMultiPerfCounterInstance("AirSync");
            ExRpcModule.Bind();
            AirSyncDiagnostics.TraceInfo <ResourceManagerHandle>(ExTraceGlobals.RequestsTracer, null, "AuthzAuthorization.ResourceManagerHandle static instance loaded", AuthzAuthorization.ResourceManagerHandle);
            AirSyncSyncStateTypeFactory.EnsureSyncStateTypesRegistered();
            FolderSyncState.RegisterCustomDataVersioningHandler(new FolderSyncState.HandleCustomDataVersioningDelegate(FolderSyncStateCustomDataInfo.HandlerCustomDataVersioning));
            FolderHierarchySyncState.RegisterCustomDataVersioningHandler(new FolderHierarchySyncState.HandleCustomDataVersioningDelegate(FolderHierarchySyncStateCustomDataInfo.HandlerCustomDataVersioning));
            EventQueue.PollingInterval = GlobalSettings.EventQueuePollingInterval;
            this.resetAutoBlockedDeviceCounterTimer = new Timer(new TimerCallback(Global.ResetAutoBlockedDeviceCounter), null, 86400000, 86400000);
        }
 public SyncStateChangedEventArgs(string folderId, FolderSyncState prevSyncState, FolderSyncState syncState)
 {
     this.FolderId      = folderId;
     this.PrevSyncState = prevSyncState;
     this.SyncState     = syncState;
 }
Esempio n. 11
0
 // Token: 0x06000CE3 RID: 3299 RVA: 0x00044E4C File Offset: 0x0004304C
 internal void ProcessCommand()
 {
     foreach (MeetingResponseCommand.RequestNodeData requestNodeData in this.longIdRequests)
     {
         StoreObjectId storeObjectId = null;
         try
         {
             storeObjectId = StoreObjectId.Deserialize(HttpUtility.UrlDecode(requestNodeData.RequestId));
             if (requestNodeData.InstanceId != ExDateTime.MinValue)
             {
                 storeObjectId = this.GetOccurenceId(storeObjectId, requestNodeData.InstanceId);
             }
         }
         catch (ArgumentException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId");
             base.PartialFailure = true;
             continue;
         }
         catch (CorruptDataException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId2");
             base.PartialFailure = true;
             continue;
         }
         catch (FormatException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, StatusCode.Sync_ProtocolVersionMismatch, requestNodeData.UserResponse, string.Format(CultureInfo.InvariantCulture, "The LongId '{0}' in the reqest is invalid!", new object[]
             {
                 requestNodeData.RequestId
             }), true);
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId3");
             base.PartialFailure = true;
             continue;
         }
         catch (AirSyncPermanentException ex)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.RequestsTracer, this, "Exception caught while processing LongId {0}\r\n{1}", requestNodeData.RequestId, ex.ToString());
             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, (!string.IsNullOrEmpty(ex.ErrorStringForProtocolLogger)) ? ex.ErrorStringForProtocolLogger : "InvalidLongId4");
             this.AppendNonSuccessXmlNode(requestNodeData.RequestId, ex.AirSyncStatusCode, requestNodeData.UserResponse, ex.ErrorStringForProtocolLogger, true);
             base.PartialFailure = true;
             continue;
         }
         try
         {
             if (!this.Respond(storeObjectId, requestNodeData.RequestId, requestNodeData, true))
             {
                 base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             }
         }
         catch (AirSyncPermanentException)
         {
             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
             base.PartialFailure = true;
             throw;
         }
     }
     foreach (string text in this.shortIdRequests.Keys)
     {
         IList <MeetingResponseCommand.RequestNodeData> list = this.shortIdRequests[text];
         using (FolderSyncState folderSyncState = base.SyncStateStorage.GetFolderSyncState(text))
         {
             for (int i = 0; i < list.Count; i++)
             {
                 try
                 {
                     string requestId = list[i].RequestId;
                     if (folderSyncState == null || folderSyncState[CustomStateDatumType.IdMapping] == null)
                     {
                         this.AppendNonSuccessXmlNode(list[i].RequestId, StatusCode.Sync_ProtocolVersionMismatch, list[i].UserResponse, string.Format(CultureInfo.InvariantCulture, "The CollectionId '{0}' in the reqest has not been synced yet.", new object[]
                         {
                             text
                         }), false);
                         base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "CollectionNotSynced");
                     }
                     else
                     {
                         StoreObjectId     storeObjectId2    = null;
                         MailboxSyncItemId mailboxSyncItemId = ((ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping])[requestId] as MailboxSyncItemId;
                         if (mailboxSyncItemId != null)
                         {
                             if (list[i].InstanceId == ExDateTime.MinValue)
                             {
                                 storeObjectId2 = (StoreObjectId)mailboxSyncItemId.NativeId;
                             }
                             else
                             {
                                 storeObjectId2 = this.GetOccurenceId((StoreObjectId)mailboxSyncItemId.NativeId, list[i].InstanceId);
                             }
                         }
                         if (storeObjectId2 == null)
                         {
                             this.AppendNonSuccessXmlNode(requestId, StatusCode.Sync_ProtocolVersionMismatch, list[i].UserResponse, string.Format(CultureInfo.InvariantCulture, "Cannot look up the meeting-request '{0}' from ItemIdMapping.", new object[]
                             {
                                 requestId
                             }), false);
                             base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidRequestId");
                         }
                         else if (!this.Respond(storeObjectId2, requestId, list[i], false))
                         {
                             base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
                         }
                     }
                 }
                 catch (AirSyncPermanentException ex2)
                 {
                     base.ProtocolLogger.IncrementValue(ProtocolLoggerData.MRErrors);
                     AirSyncDiagnostics.TraceDebug <string, string>(ExTraceGlobals.RequestsTracer, this, "Exception caught while processing meeting-request {0}\r\n{1}", list[i].RequestId, ex2.ToString());
                     base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, (!string.IsNullOrEmpty(ex2.ErrorStringForProtocolLogger)) ? ex2.ErrorStringForProtocolLogger : "InvalidLongId4");
                     this.AppendNonSuccessXmlNode(list[i].RequestId, ex2.AirSyncStatusCode, list[i].UserResponse, ex2.ErrorStringForProtocolLogger, false);
                     base.PartialFailure = true;
                 }
             }
         }
     }
 }
Esempio n. 12
0
 private void OnSyncStateChanged(Folder folder, FolderSyncState prevSyncState, FolderSyncState newSyncState)
 {
     this.eventDispatcher.Raise(this.SyncStateChanged, new FolderSyncStateChangedEventArgs(folder.FolderId, prevSyncState, newSyncState));
 }
 private void OnSyncStateChanged(string folderId, FolderSyncState oldState, FolderSyncState syncState)
 {
     this.SyncStateChanged?.Invoke(this, new SyncStateChangedEventArgs(folderId, oldState, syncState));
 }
 private void OnSyncStateChanged(string folderId, FolderSyncState oldState, FolderSyncState syncState)
 {
     var handler = this.SyncStateChanged;
     if (handler != null)
         handler(this, new SyncStateChangedEventArgs(folderId, oldState, syncState));
 }
        // Token: 0x06001561 RID: 5473 RVA: 0x0007D91C File Offset: 0x0007BB1C
        protected StoreObjectId GetSmartItemId()
        {
            this.ParseXmlRequest();
            string          collectionId    = this.CollectionId;
            string          itemId          = this.ItemId;
            string          longId          = this.LongId;
            StoreObjectId   storeObjectId   = null;
            FolderSyncState folderSyncState = null;
            StoreObjectId   result;

            try
            {
                if (longId != null)
                {
                    if (base.Version < 120)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "LongIdSupportedinV12Only");
                        throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidCombinationOfIDs, null, false);
                    }
                    try
                    {
                        storeObjectId = StoreObjectId.Deserialize(longId);
                        goto IL_1F1;
                    }
                    catch (ArgumentException innerException)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException, false);
                    }
                    catch (FormatException innerException2)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId2");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException2, false);
                    }
                    catch (CorruptDataException innerException3)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidLongId3");
                        throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException3, false);
                    }
                }
                if (collectionId == null)
                {
                    StoreObjectId defaultFolderId = base.MailboxSession.GetDefaultFolderId(DefaultFolderType.Inbox);
                    MailboxSyncProviderFactory syncProviderFactory = new MailboxSyncProviderFactory(base.MailboxSession, defaultFolderId);
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(syncProviderFactory);
                }
                else
                {
                    SyncCollection.CollectionTypes collectionType = AirSyncUtility.GetCollectionType(collectionId);
                    if (collectionType != SyncCollection.CollectionTypes.Mailbox && collectionType != SyncCollection.CollectionTypes.Unknown)
                    {
                        base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "SendFromVirtualFolder");
                        throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidCombinationOfIDs, null, false);
                    }
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(collectionId);
                }
                if (folderSyncState == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "SyncStateNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.SyncStateNotFound, null, false);
                }
                ItemIdMapping itemIdMapping = (ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping];
                if (itemIdMapping == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemIdMappingNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.ItemNotFound, null, false);
                }
                MailboxSyncItemId mailboxSyncItemId = itemIdMapping[itemId] as MailboxSyncItemId;
                storeObjectId = ((mailboxSyncItemId == null) ? null : ((StoreObjectId)mailboxSyncItemId.NativeId));
                if (storeObjectId == null)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "ItemIdMappingNotFound");
                    throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.ItemNotFound, null, false);
                }
                folderSyncState.Dispose();
                folderSyncState = null;
IL_1F1:
                result = storeObjectId;
            }
            finally
            {
                if (folderSyncState != null)
                {
                    folderSyncState.Dispose();
                }
            }
            return(result);
        }
 public FolderSyncStateChangeEventArgs(Folder folder, FolderSyncState prevSyncState, FolderSyncState syncState)
 {
     this.Folder = folder;
     this.PrevSyncState = prevSyncState;
     this.SyncState = syncState;
 }
        internal override Command.ExecutionState ExecuteCommand()
        {
            string          attachmentName  = this.AttachmentName;
            string          value           = string.Empty;
            FolderSyncState folderSyncState = null;

            AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, this, "GetAttachmentCommand.Execute(). AttachmentName: '{0}'", attachmentName);
            try
            {
                int incBy = 0;
                if (base.Request.ContentType != null && !string.Equals(base.Request.ContentType, "message/rfc822", StringComparison.OrdinalIgnoreCase))
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidContentType");
                    throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.First140Error, null, false);
                }
                int           num           = attachmentName.IndexOf(':');
                ItemIdMapping itemIdMapping = null;
                if (num != -1 && num != attachmentName.LastIndexOf(':'))
                {
                    folderSyncState = base.SyncStateStorage.GetFolderSyncState(new MailboxSyncProviderFactory(base.MailboxSession), attachmentName.Substring(0, num));
                    if (folderSyncState == null)
                    {
                        throw new ObjectNotFoundException(ServerStrings.MapiCannotOpenAttachmentId(attachmentName));
                    }
                    itemIdMapping = (ItemIdMapping)folderSyncState[CustomStateDatumType.IdMapping];
                    if (itemIdMapping == null)
                    {
                        throw new ObjectNotFoundException(ServerStrings.MapiCannotOpenAttachmentId(attachmentName));
                    }
                }
                PolicyData policyData = ADNotificationManager.GetPolicyData(base.User);
                if (policyData != null && !policyData.AttachmentsEnabled)
                {
                    base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "AttachmentsNotEnabledGetAttCmd");
                    throw new AirSyncPermanentException(HttpStatusCode.Forbidden, StatusCode.AccessDenied, null, false);
                }
                Unlimited <ByteQuantifiedSize> maxAttachmentSize = (policyData != null) ? policyData.MaxAttachmentSize : Unlimited <ByteQuantifiedSize> .UnlimitedValue;
                value = AttachmentHelper.GetAttachment(base.MailboxSession, attachmentName, base.OutputStream, maxAttachmentSize, itemIdMapping, out incBy);
                base.ProtocolLogger.IncrementValue(ProtocolLoggerData.Attachments);
                base.ProtocolLogger.IncrementValueBy(ProtocolLoggerData.AttachmentBytes, incBy);
            }
            catch (FormatException innerException)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidAttachmentName");
                AirSyncPermanentException ex = new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.InvalidIDs, innerException, false);
                throw ex;
            }
            catch (ObjectNotFoundException innerException2)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "AttachmentNotFound");
                AirSyncPermanentException ex2 = new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.None, innerException2, false);
                throw ex2;
            }
            catch (IOException innerException3)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "IOException");
                throw new AirSyncPermanentException(HttpStatusCode.InternalServerError, StatusCode.None, innerException3, false);
            }
            catch (DataTooLargeException innerException4)
            {
                base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "AttachmentIsTooLarge");
                PolicyData policyData2 = ADNotificationManager.GetPolicyData(base.User);
                if (policyData2 != null)
                {
                    policyData2.MaxAttachmentSize.ToString();
                }
                else
                {
                    GlobalSettings.MaxDocumentDataSize.ToString(CultureInfo.InvariantCulture);
                }
                throw new AirSyncPermanentException(HttpStatusCode.RequestEntityTooLarge, StatusCode.AttachmentIsTooLarge, innerException4, false);
            }
            finally
            {
                if (folderSyncState != null)
                {
                    folderSyncState.Dispose();
                    folderSyncState = null;
                }
            }
            base.Context.Response.AppendHeader("Content-Type", value);
            return(Command.ExecutionState.Complete);
        }
 public FolderSyncStateChangeEventArgs(Folder folder, FolderSyncState prevSyncState, FolderSyncState syncState)
 {
     this.Folder        = folder;
     this.PrevSyncState = prevSyncState;
     this.SyncState     = syncState;
 }
        // Token: 0x060008FD RID: 2301 RVA: 0x00035984 File Offset: 0x00033B84
        internal static void HandlerCustomDataVersioning(FolderSyncState syncState)
        {
            if (syncState == null)
            {
                throw new ArgumentNullException("syncState");
            }
            if (syncState.CustomVersion == null && syncState.SyncStateIsNew)
            {
                return;
            }
            bool flag = true;

            if (syncState.CustomVersion == null || syncState.CustomVersion <= 2 || syncState.CustomVersion > 9)
            {
                flag = false;
            }
            else if (syncState.CustomVersion.Value != 9)
            {
                switch (syncState.CustomVersion.Value)
                {
                case 3:
                    syncState["CachedOptionsNode"] = null;
                    break;

                case 4:
                    break;

                case 5:
                    goto IL_117;

                case 6:
                    goto IL_12C;

                case 7:
                    goto IL_13D;

                case 8:
                    goto IL_143;

                default:
                    flag = false;
                    goto IL_158;
                }
                object obj = syncState[CustomStateDatumType.AirSyncProtocolVersion];
                if (obj is ConstStringData)
                {
                    string data  = syncState.GetData <ConstStringData, string>(CustomStateDatumType.AirSyncProtocolVersion, null);
                    int    data2 = 20;
                    if (data != null)
                    {
                        data2 = AirSyncUtility.ParseVersionString(data);
                    }
                    syncState[CustomStateDatumType.AirSyncProtocolVersion] = new Int32Data(data2);
                }
IL_117:
                syncState["MaxItems"] = new Int32Data(int.MaxValue);
IL_12C:
                syncState["ConversationMode"] = new BooleanData(false);
IL_13D:
                FolderSyncStateCustomDataInfo.ConvertV7StickyOptions(syncState);
IL_143:
                syncState["Permissions"] = new Int32Data(0);
            }
IL_158:
            if (!flag)
            {
                syncState.HandleCorruptSyncState();
            }
        }
Esempio n. 20
0
 public void SetFolderState(string name, int filesSynced)
 {
     Folders[name] = new FolderSyncState(name, DateTimeOffset.Now, filesSynced);
 }
 public FolderSyncStateChangedEventArgs(string folderId, FolderSyncState prevSyncState, FolderSyncState syncState)
 {
     this.FolderId = folderId;
     this.PrevSyncState = prevSyncState;
     this.SyncState = syncState;
 }
 private void OnSyncStateChanged(Folder folder, FolderSyncState prevSyncState, FolderSyncState newSyncState)
 {
     this.eventDispatcher.Raise(this.SyncStateChanged, new FolderSyncStateChangeEventArgs(folder, prevSyncState, newSyncState));
 }
 private void OnSyncStateChanged(string folderId, FolderSyncState oldState, FolderSyncState syncState)
 {
     this.SyncStateChanged?.Invoke(this, new SyncStateChangedEventArgs(folderId, oldState, syncState));
 }