예제 #1
0
        private HashNode AddLocalAddressBook(IResource mapiFolder)
        {
            if (Folder.IsDeletedItems(mapiFolder))
            {
                Folder.SetIgnoreImportAsync(mapiFolder, _folderType, true);
                return(null);
            }
            IResource parentFolder = Folder.GetParent(mapiFolder);

            if (parentFolder == null)
            {
                ResourceProxy proxy = new ResourceProxy(mapiFolder);
                proxy.DeleteAsync();
                return(null);
            }
            if (Folder.IsRoot(parentFolder))
            {
                return(_rootNode.InsertResource(mapiFolder));
            }
            else
            {
                HashNode hasNode =
                    AddLocalAddressBook(parentFolder);
                if (hasNode == null)
                {
                    Folder.SetIgnoreImportAsync(mapiFolder, _folderType, true);
                    return(null);
                }
                return(hasNode.InsertResource(mapiFolder));
            }
        }
예제 #2
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
        public static bool IsAncestor(IResource folder, IResource possibleAncestor)
        {
            IResource current = Folder.GetParent(folder);

            while (!Folder.IsRoot(current))
            {
                if (current == possibleAncestor)
                {
                    return(true);
                }
                current = Folder.GetParent(current);
            }
            return(false);
        }
예제 #3
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
        public static bool HasDeletedItemsAsAncestor(IResource folder)
        {
            IResource current = Folder.GetParent(folder);

            while (!Folder.IsRoot(current))
            {
                if (Folder.IsDeletedItems(current))
                {
                    return(true);
                }
                current = Folder.GetParent(current);
            }
            return(false);
        }