public SymbolRule Add(string name)
        {
            SymbolRule symbolRule = new SymbolRule();

            symbolRule.Name = name;
            Add(symbolRule);
            return(symbolRule);
        }
        public override object GetValue(object component)
        {
            SymbolRule symbolRule = (SymbolRule)component;

            if (Name == "FromValue")
            {
                return(field.Parse(symbolRule.FromValue));
            }
            return(field.Parse(symbolRule.ToValue));
        }
        public override void SetValue(object component, object value)
        {
            SymbolRule symbolRule = (SymbolRule)component;

            if (Name == "FromValue")
            {
                symbolRule.FromValue = Field.ToStringInvariant(value);
            }
            else
            {
                symbolRule.ToValue = Field.ToStringInvariant(value);
            }
        }
Beispiel #4
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, noCustomTypeDesc: false);
            SymbolRule symbolRule = (SymbolRule)value;

            symbolRule.GetField();
            PropertyDescriptorCollection propertyDescriptorCollection = new PropertyDescriptorCollection(null);

            for (int i = 0; i < properties.Count; i++)
            {
                if (properties[i].IsBrowsable)
                {
                    if (properties[i].Name == "LegendText" && symbolRule.ShowInLegend == "(none)")
                    {
                        propertyDescriptorCollection.Add(TypeDescriptor.CreateProperty(value.GetType(), properties[i], new ReadOnlyAttribute(isReadOnly: true)));
                    }
                    else
                    {
                        propertyDescriptorCollection.Add(properties[i]);
                    }
                }
            }
            return(propertyDescriptorCollection);
        }
 public void Remove(SymbolRule value)
 {
     base.List.Remove(value);
 }
 public int Add(SymbolRule value)
 {
     return(base.List.Add(value));
 }