Beispiel #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));
            }
        }
Beispiel #2
0
 private void Save(TreeNodeCollection nodes)
 {
     foreach (TreeNode node in nodes)
     {
         IResource resource = (IResource)node.Tag;
         if (resource != null)
         {
             bool ignore = (GetNodeCheckState(node) == NodeCheckState.Unchecked);
             Folder.SetIgnoreImportAsync(resource, _folderType, ignore);
         }
         Save(node.Nodes);
     }
 }