Exemplo n.º 1
0
        public PropertyNode CreatePropertyNode(PropertyDescriptor item, object targetComponent, IPropertyGridLocalizer localizer, PropertySettings settings, bool isMultiObject)
        {
            PropertyNode node = null;

            if (item.PropertyType == typeof(Color))
                node = new PropertyNodeColor(item);
            else if (item.PropertyType == typeof(bool))
                node = new PropertyCheckBoxNode(item);
            else if (settings != null && settings.PropertyNodeType == ePropertyNodeType.RadioButtonList)
                node = new PropertyOptionListNode(item);
            else
                node = new PropertyNode(item);

            node.IsMultiObject = isMultiObject;
            node.NodesIndent = _ChildPropertiesIndent;
            node.ImageAlignment = eCellPartAlignment.FarCenter;
            string name = localizer.GetPropertyName(item.Name);
            if (string.IsNullOrEmpty(name)) name = item.DisplayName;
            node.Text = name;
            node.TargetComponent = targetComponent;
            Cell cell = new Cell();
            cell.Selectable = false;
            node.Cells.Add(cell);
            
            node.PropertySettings = settings;

            return node;
        }
Exemplo n.º 2
0
 public Node CreateCategoryNode(string category, IPropertyGridLocalizer localizer)
 {
     PropertyCategoryNode node = new PropertyCategoryNode();
     if (_StyleProvider != null)
         node.Style = _StyleProvider.CategoryStyle;
     string name = localizer.GetCategoryName(category);
     if (string.IsNullOrEmpty(name)) name = category;
     node.Text = name;
     node.Expanded = true;
     node.FullRowBackground = true;
     node.Selectable = true;
     node.CellNavigationEnabled = false;
     return node;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the PropertyParser class.
 /// </summary>
 /// <param name="selectedObject"></param>
 public PropertyParser(object[] selectedObjects,
     Attribute[] attributeFilter,
     PropertyNodeFactory nodeFactory,
     List<string> ignoredProperties,
     List<string> ignoredCategories,
     IPropertyGridLocalizer localizer,
     PropertySettingsCollection propertySettings)
 {
     _SelectedObjects = selectedObjects;
     _AttributeFilter = attributeFilter;
     _PropertyNodeFactory = nodeFactory;
     _IgnoredProperties = ignoredProperties;
     _IgnoredCategories = ignoredCategories;
     _Localizer = localizer;
     _PropertySettings = propertySettings;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the PropertyParser class.
 /// </summary>
 /// <param name="selectedObject"></param>
 public PropertyParser(
     ITypeDescriptorContext context, 
     object selectedObject,
     Attribute[] attributeFilter,
     PropertyNodeFactory nodeFactory,
     List<string> ignoredProperties,
     List<string> ignoredCategories,
     IPropertyGridLocalizer localizer,
     PropertySettingsCollection propertySettings)
 {
     _TypeDescriptorContext = context;
     _SelectedObject = selectedObject;
     _AttributeFilter = attributeFilter;
     _PropertyNodeFactory = nodeFactory;
     _IgnoredProperties = ignoredProperties;
     _IgnoredCategories = ignoredCategories;
     _Localizer = localizer;
     _PropertySettings = propertySettings;
 }
Exemplo n.º 5
0
 public PropertyNode CreatePropertyNode(PropertyDescriptor item, object targetComponent, IPropertyGridLocalizer localizer, PropertySettingsCollection propertySettings, bool isMultiObject)
 {
     PropertySettings settings = propertySettings[item, item.Name];
     return CreatePropertyNode(item, targetComponent, localizer, settings, isMultiObject);
 }