예제 #1
0
        public static CustomCategorySelector GetCustomCategorySelector(PropertyReferenceProperty property)
        {
            CustomCategorySelector selectorByCategoryName;

            if ((selectorByCategoryName = CategoryFactory.GetCategorySelectorByCategoryName(CategoryLocalizationHelper.GetCanonicalCategoryName(property.CategoryName))) != null)
            {
                return(selectorByCategoryName);
            }
            if (BehaviorHelper.IsPropertyBehaviorCommand(property))
            {
                return((CustomCategorySelector) new CategoryFactory.BehaviorCommandCategorySelector());
            }
            return(new CustomCategorySelector());
        }
        private CategoryBase CreateCategory(string name, Type selectedType)
        {
            CategoryLocalizationHelper.CategoryName canonicalCategoryName = CategoryLocalizationHelper.GetCanonicalCategoryName(name);
            CategoryBase      categoryBase        = (CategoryBase)CategoryFactory.GetCustomCategorySelector(canonicalCategoryName).CreateSceneNodeCategory(canonicalCategoryName, name, this.SceneNodeObjectSet.DesignerContext.MessageLoggingService);
            ITypeResolver     typeResolver        = (ITypeResolver)this.SceneNodeObjectSet.ProjectContext;
            CategoryEditorSet categoryEditorsList = new CategoryEditorSet();
            IType             type = typeResolver.GetType(selectedType);

            PropertyInspectorModel.GetCategoryEditors(type, categoryEditorsList, this.MessageLoggingService);
            foreach (CategoryEditor categoryEditor in categoryEditorsList.Union(CategoryEditorInstanceFactory.GetEditors((ITypeId)type, categoryBase as SceneNodeCategory)))
            {
                if (categoryEditor.TargetCategory == categoryBase.CategoryName)
                {
                    categoryBase.CategoryEditors.Add(categoryEditor);
                }
            }
            return(categoryBase);
        }
예제 #3
0
        private CategoryBase CreateCategory(string name, Type selectedType)
        {
            CategoryLocalizationHelper.CategoryName canonicalCategoryName = CategoryLocalizationHelper.GetCanonicalCategoryName(name);
            CategoryBase      categoryBase        = (CategoryBase)CategoryFactory.GetCustomCategorySelector(canonicalCategoryName).CreateSceneNodeCategory(canonicalCategoryName, name, this.SceneNodeObjectSet.DesignerContext.MessageLoggingService);
            ITypeResolver     typeResolver        = (ITypeResolver)this.SceneNodeObjectSet.ProjectContext;
            CategoryEditorSet categoryEditorsList = new CategoryEditorSet();
            IType             type = typeResolver.GetType(selectedType);

            PropertyInspectorModel.GetCategoryEditors(type, categoryEditorsList, this.MessageLoggingService);
            using (IEnumerator <CategoryEditor> enumerator = categoryEditorsList.Union(CategoryEditorInstanceFactory.GetEditors((ITypeId)type, categoryBase as SceneNodeCategory)).GetEnumerator())
            {
                while (((IEnumerator)enumerator).MoveNext())
                {
                    CategoryEditor current = enumerator.Current;
                    if (current.get_TargetCategory() == categoryBase.get_CategoryName())
                    {
                        categoryBase.CategoryEditors.Add(current);
                    }
                }
            }
            return(categoryBase);
        }
예제 #4
0
 public static CustomCategorySelector GetCustomCategorySelector(CategoryLocalizationHelper.CategoryName category)
 {
     return(CategoryFactory.GetCategorySelectorByCategoryName(category) ?? new CustomCategorySelector());
 }