コード例 #1
0
ファイル: MAPIFolderTreeView.cs プロジェクト: mo5h/omeo
        private void InsertTreeNodes(TreeNodeCollection nodes, HashNode hashNode)
        {
            foreach (HashMap.Entry entry in hashNode.HashNodes)
            {
                IResource resource = ((HashNode)entry.Value).Resource;

                if (resource.Id == -1 || (resource.Type == STR.MAPIFolder))
                {
                    IResource store = Folder.GetMAPIStorage(resource);
                    if (store.HasProp(PROP.IgnoredFolder))
                    {
                        continue;
                    }
                }

                int       iconIndex   = 0;
                IResource resourceTag = null;
                if (Folder.IsFolderOfType(resource, _folderType))
                {
                    iconIndex   = _resourceIconManager.GetDefaultIconIndex(_resourceTypeForIcons);
                    resourceTag = resource;
                }
                else
                {
                    iconIndex = _resourceIconManager.GetDefaultIconIndex("MAPIFolder");
                }
                TreeNode treeNode = new TreeNode(resource.DisplayName, iconIndex, iconIndex);
                treeNode.Tag = resourceTag;
                nodes.Add(treeNode);
                SetNodeCheckStateFromCollection(treeNode);
                InsertTreeNodes(treeNode.Nodes, (HashNode)entry.Value);
            }
        }
コード例 #2
0
ファイル: MailDescriptor.cs プロジェクト: mo5h/omeo
        private void LinkToFolder(IResource resMail)
        {
            IResource resFolder = null;

            if (_folder != null)
            {
                resFolder = Folder.Find(_folder.FolderIDs.EntryId);
            }
            if (resFolder != null)
            {
                Folder.LinkMail(resFolder, resMail);
                IResource msgStore = Folder.GetMAPIStorage(resFolder);
                if (msgStore.GetDateProp(PROP.LastReceiveDate) < _receivedTime)
                {
                    msgStore.SetProp(PROP.LastReceiveDate, _receivedTime);
                }
            }
            else
            {
                _tracer.Trace("Can't link mail to folder");
            }
        }