コード例 #1
0
        public SymbolRule Add(string name)
        {
            SymbolRule symbolRule = new SymbolRule();

            symbolRule.Name = name;
            this.Add(symbolRule);
            return(symbolRule);
        }
コード例 #2
0
        public override object GetValue(object component)
        {
            SymbolRule symbolRule = (SymbolRule)component;

            if (this.Name == "FromValue")
            {
                return(this.field.Parse(symbolRule.FromValue));
            }
            return(this.field.Parse(symbolRule.ToValue));
        }
コード例 #3
0
        public override void SetValue(object component, object value)
        {
            SymbolRule symbolRule = (SymbolRule)component;

            if (this.Name == "FromValue")
            {
                symbolRule.FromValue = Field.ToStringInvariant(value);
            }
            else
            {
                symbolRule.ToValue = Field.ToStringInvariant(value);
            }
        }
コード例 #4
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(value, 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(true)));
                    }
                    else
                    {
                        propertyDescriptorCollection.Add(properties[i]);
                    }
                }
            }
            return(propertyDescriptorCollection);
        }
コード例 #5
0
 protected override void OnInsertComplete(int index, object value)
 {
     base.OnInsertComplete(index, value);
     SymbolRule symbolRule = (SymbolRule)value;
 }
コード例 #6
0
 public void Remove(SymbolRule value)
 {
     base.List.Remove(value);
 }
コード例 #7
0
 public int Add(SymbolRule value)
 {
     return(base.List.Add(value));
 }