예제 #1
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
        public static bool IsDefault(IResource folder)
        {
            Guard.NullArgument(folder, "folder");

            if (Folder.IsParentRoot(folder))
            {
                return(true);
            }
            IResource mapiStore     = GetMAPIStorage(folder);
            string    storeId       = mapiStore.GetStringProp(PROP.StoreID);
            IResource mapiInfoStore = Core.ResourceStore.FindUniqueResource(STR.MAPIInfoStore, PROP.EntryID, storeId);

            if (mapiInfoStore == null)
            {
                throw new ApplicationException("Folder.IsDefault -- MAPIStore resource result is null.");
            }

            IStringList list = mapiInfoStore.GetStringListProp(PROP.DefaultFolderEntryIDs);

            if (list == null)
            {
                throw new ApplicationException("Folder.IsDefault -- List of default store folders is NULL.");
            }
            return(list.IndexOf(folder.GetStringProp(PROP.EntryID)) != -1);
        }
예제 #2
0
파일: MAPIFolder.cs 프로젝트: mo5h/omeo
        public static void AddSubFolder(FolderDescriptor folder, FolderDescriptor subFolder)
        {
            IResource parentFolder = null;

            if (folder != null)
            {
                parentFolder = Find(folder.FolderIDs.EntryId);
            }
            IResource resFolder = FindOrCreate(subFolder, parentFolder);

            if (Folder.IsParentRoot(resFolder) || Folder.IsParentParentRoot(resFolder))
            {
                SetDefault(resFolder, true);
            }
        }
예제 #3
0
 protected override void Execute()
 {
     if (_folder != null && !String.IsNullOrEmpty(_folder.FolderIDs.EntryId))
     {
         IResource resFolder = Folder.Find(_folder.FolderIDs.EntryId);
         if (resFolder != null)
         {
             if (!Folder.IsParentRoot(resFolder))
             {
                 Folder.SetName(resFolder, _folder.Name);
             }
             if (_isMovedFolder && _parentFolder != null)
             {
                 IResource resParentFolder = Folder.Find(_parentFolder.FolderIDs.EntryId);
                 if (resParentFolder != null)
                 {
                     Folder.SetParent(resFolder, resParentFolder);
                 }
             }
         }
         FolderStructureDescriptor.UpdateContactFolder(_folder);
     }
 }