예제 #1
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
 private static void SetIgnoredRecursive(IResource folder)
 {
     SetIgnored(folder, true);
     foreach (IResource subFolder in Folder.GetSubFolders(folder))
     {
         SetIgnoredRecursive(subFolder);
     }
 }
예제 #2
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
 private static void DeleteFoldersRecursive(IResource folder)
 {
     foreach (IResource subFolder in Folder.GetSubFolders(folder).ValidResources)
     {
         DeleteFoldersRecursive(subFolder);
     }
     DeleteFolderAndMail(folder);
 }
예제 #3
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
 public static void DeleteFolderRecursive(IResource folder)
 {
     foreach (IResource childFolder in Folder.GetSubFolders(folder))
     {
         DeleteFolderRecursive(childFolder);
     }
     DeleteFolder(folder);
 }
예제 #4
0
        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);
        }
예제 #5
0
파일: MessageActions.cs 프로젝트: mo5h/omeo
        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);
            }
        }