private static void SetIgnoredRecursive(IResource folder) { SetIgnored(folder, true); foreach (IResource subFolder in Folder.GetSubFolders(folder)) { SetIgnoredRecursive(subFolder); } }
private static void DeleteFoldersRecursive(IResource folder) { foreach (IResource subFolder in Folder.GetSubFolders(folder).ValidResources) { DeleteFoldersRecursive(subFolder); } DeleteFolderAndMail(folder); }
public static void DeleteFolderRecursive(IResource folder) { foreach (IResource childFolder in Folder.GetSubFolders(folder)) { DeleteFolderRecursive(childFolder); } DeleteFolder(folder); }
private bool IsAllChildrenIgnored(IResource folder) { IResourceList subFolders = Folder.GetSubFolders(folder); foreach (IResource subFolder in subFolders.ValidResources) { if (!Folder.IsIgnored(subFolder) || !IsAllChildrenIgnored(subFolder)) { return(false); } } return(true); }
public static void DeleteFolder(IResource folder, bool deletedItems) { if (Folder.IsDefault(folder)) { return; } IResourceList folders = Folder.GetDefaultDeletedItemsFolder(); HashSet childrenNames = new HashSet(); foreach (IResource resFolder in folders) { foreach (IResource child in Folder.GetSubFolders(resFolder)) { childrenNames.Add(child.GetPropText(Core.Props.Name)); } } string name = folder.GetPropText(Core.Props.Name); string oldName = name; bool rename = false; for (int j = 1;; j++) { if (!childrenNames.Contains(name)) { break; } name = oldName + j.ToString(); rename = true; } PairIDs pairIds = PairIDs.Get(folder); if (pairIds != null) { if (deletedItems && rename) { OutlookSession.DeleteFolderWithRename(pairIds, name); } else { OutlookSession.DeleteFolder(pairIds, deletedItems); } } if (!deletedItems) { Core.ResourceAP.QueueJob(JobPriority.AboveNormal, new ResourceDelegate(DeleteFolderResource), folder); } }