示例#1
0
        /**
         * Returns the root of categories with the specified content type.
         */

        public IResource GetRootForTypedCategory(string resType)
        {
            IResource root        = _resourceTreeManager.GetRootForType("Category:" + resType);
            string    displayName = _store.ResourceTypes [resType].DisplayName + " Categories";

            if (root.DisplayName != displayName)
            {
                ResourceProxy proxy = new ResourceProxy(root);
                proxy.BeginUpdate();
                proxy.SetDisplayName(displayName);
                proxy.SetProp(Core.Props.ContentType, resType);
                proxy.SetProp(Core.Props.Open, 1);
                proxy.EndUpdate();
            }
            _resourceTreeManager.SetResourceNodeSort(root, "Name");
            _resourceTreeManager.LinkToResourceRoot(root, 21);
            return(root);
        }