Esempio n. 1
0
        /**
         * Creates the new category root resource (which is the standard root of
         * resource type Category) and, if necessary, deletes the old root (which
         * was a category marked with the IsRoot property).
         */

        private void UpdateCategoryRoot()
        {
            _rootCategory             = _resourceTreeManager.GetRootForType("Category");
            _rootCategory.DisplayName = "Categories";
            _rootCategory.SetProp(Core.Props.Open, 1);
            _resourceTreeManager.SetResourceNodeSort(_rootCategory, "Name");
            _resourceTreeManager.LinkToResourceRoot(_rootCategory, 20);

            IResourceList typedCategories = _store.FindResourcesWithProp("Category", Core.Props.ContentType);

            foreach (IResource res in typedCategories)
            {
                if (res.GetLinkProp("Parent") == _rootCategory)
                {
                    IResource rootForType = GetRootForTypedCategory(res.GetStringProp(Core.Props.ContentType));
                    res.SetProp("Parent", rootForType);
                }
            }
        }
Esempio n. 2
0
 static Folder()
 {
     _resourceTreeManager = ICore.Instance.ResourceTreeManager;
     _mapiFolderRoot      = _resourceTreeManager.GetRootForType(STR.MAPIFolder);
 }