示例#1
0
 void IDestinationMailbox.DeleteFolder(FolderRec folderRec)
 {
     MrsTracer.Provider.Function("StorageDestinationMailbox.DeleteFolder(\"{0}\")", new object[]
     {
         folderRec.FolderName
     });
     base.VerifyMailboxConnection(VerifyMailboxConnectionFlags.None);
     using (base.RHTracker.Start())
     {
         using (CoreFolder coreFolder = CoreFolder.Bind(base.StoreSession, base.GetFolderId(folderRec.ParentId)))
         {
             GroupOperationResult groupOperationResult = coreFolder.DeleteFolder(DeleteFolderFlags.DeleteMessages | DeleteFolderFlags.DeleteSubFolders, StoreObjectId.FromProviderSpecificId(folderRec.EntryId));
             if (groupOperationResult.OperationResult != OperationResult.Succeeded)
             {
                 MrsTracer.Provider.Error("StorageDestinationMailbox.DeleteFolder failed with '{0}'. Folder name: '{1}', type: '{2}', entry id: '{3}'.", new object[]
                 {
                     groupOperationResult.Exception.ToString(),
                     folderRec.FolderName,
                     folderRec.FolderType,
                     TraceUtils.DumpEntryId(folderRec.EntryId)
                 });
                 groupOperationResult.Exception.PreserveExceptionStack();
                 throw groupOperationResult.Exception;
             }
         }
     }
 }