コード例 #1
0
ファイル: FolderTree.cs プロジェクト: YHZX2013/exchange_diff
 public void UnlinkChild(ISyncItemId parentId, ISyncItemId childId)
 {
     FolderTree.FolderInfo folderInfo  = this.GetFolderInfo(parentId);
     FolderTree.FolderInfo folderInfo2 = this.GetFolderInfo(childId);
     if (!parentId.Equals(folderInfo2.ParentId) || !folderInfo.Children.Contains(childId))
     {
         AirSyncDiagnostics.TraceError <ISyncItemId, ISyncItemId, ISyncItemId>(ExTraceGlobals.AlgorithmTracer, this, "Tried to unlink a child folder from a folder that was not its parent.  ChildSyncId: {0}, child's ParentSyncId: {1}, ParentSyncId passed in: {2}", childId, folderInfo2.ParentId, parentId);
         this.TraceTree();
         return;
     }
     if (folderInfo.Children.Remove(childId))
     {
         this.GetFolderInfo(childId).ParentId = null;
         this.isDirty = true;
     }
 }
コード例 #2
0
 // Token: 0x060008EC RID: 2284 RVA: 0x00035640 File Offset: 0x00033840
 protected void Add(ISyncItemId mailboxId, string syncId)
 {
     AirSyncDiagnostics.Assert(mailboxId != null);
     AirSyncDiagnostics.Assert(syncId != null);
     if (this.syncIdToMailboxIdTable.ContainsKey(syncId))
     {
         ISyncItemId syncItemId = this.syncIdToMailboxIdTable[syncId];
         if (syncItemId.Equals(mailboxId))
         {
             return;
         }
         throw new InvalidOperationException("SyncId has already been mapped to a different MailboxId");
     }
     else if (this.usingWriteBuffer && this.addedItemsWriteBuffer.ContainsKey(syncId))
     {
         ISyncItemId syncItemId2 = this.addedItemsWriteBuffer[syncId];
         if (syncItemId2.Equals(mailboxId))
         {
             return;
         }
         throw new InvalidOperationException("SyncId has already been mapped to a different MailboxId");
     }
     else
     {
         if (this.mailboxIdToSyncIdTable.ContainsKey(mailboxId) || (this.usingWriteBuffer && this.addedItemsWriteBufferReversed.ContainsKey(mailboxId)))
         {
             throw new InvalidOperationException("MailboxId has already been mapped to a different SyncId");
         }
         if (this.usingWriteBuffer)
         {
             this.addedItemsWriteBuffer[syncId]            = mailboxId;
             this.addedItemsWriteBufferReversed[mailboxId] = syncId;
             this.uniqueCounter += 1L;
             return;
         }
         this.syncIdToMailboxIdTable.Add(syncId, mailboxId);
         this.mailboxIdToSyncIdTable.Add(mailboxId, syncId);
         this.addedItems.Add(syncId);
         this.uniqueCounter += 1L;
         this.dirty          = true;
         return;
     }
 }