public void DeleteFolder(StoreId parentFolderId, StoreId folderId, DeleteFolderFlags deleteFlags) { using (PublicFolderConnectionLimitsTracker.Instance.GetToken(this.PrimaryHierarchyMailboxPrincipal.MailboxInfo.Location.ServerFqdn)) { StoreSession storeSession = null; object thisObject = null; bool flag = false; try { if (storeSession != null) { storeSession.BeginMapiCall(); storeSession.BeginServerHealthCall(); flag = true; } if (StorageGlobals.MapiTestHookBeforeCall != null) { StorageGlobals.MapiTestHookBeforeCall(MethodBase.GetCurrentMethod()); } using (MapiStore hierarchyStore = this.GetHierarchyStore()) { using (MapiFolder mapiFolder = (MapiFolder)hierarchyStore.OpenEntry(this.GetDestinationSpecificEntryId(hierarchyStore, parentFolderId))) { mapiFolder.DeleteFolder(this.GetDestinationSpecificEntryId(hierarchyStore, folderId), deleteFlags); } } } catch (MapiPermanentException ex) { throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCopyMessagesFailed, ex, storeSession, thisObject, "{0}. MapiException = {1}.", new object[] { string.Format("RPCPrimaryHierarchyProvider.DeleteFolder : folderId = {0}", folderId), ex }); } catch (MapiRetryableException ex2) { throw StorageGlobals.TranslateMapiException(ServerStrings.MapiCopyMessagesFailed, ex2, storeSession, thisObject, "{0}. MapiException = {1}.", new object[] { string.Format("RPCPrimaryHierarchyProvider.DeleteFolder : folderId = {0}", folderId), ex2 }); } finally { try { if (storeSession != null) { storeSession.EndMapiCall(); if (flag) { storeSession.EndServerHealthCall(); } } } finally { if (StorageGlobals.MapiTestHookAfterCall != null) { StorageGlobals.MapiTestHookAfterCall(MethodBase.GetCurrentMethod()); } } } } }
/// <summary> /// Parse the RopDeleteFolderRequest structure. /// </summary> /// <param name="s">An stream containing RopDeleteFolderRequest structure.</param> public override void Parse(Stream s) { base.Parse(s); this.RopId = (RopIdType)ReadByte(); this.LogonId = ReadByte(); this.InputHandleIndex = ReadByte(); this.DeleteFolderFlags = (DeleteFolderFlags)ReadByte(); this.FolderId = new FolderID(); this.FolderId.Parse(s); }