System.ComponentModel.PropertyDescriptorCollection.Remove C# (CSharp) Method

Remove() public method

public Remove ( PropertyDescriptor value ) : void
value PropertyDescriptor
return void
        public void Remove(PropertyDescriptor value) {
            if (readOnly) {
                throw new NotSupportedException();
            }

            int index = IndexOf(value);
            
            if (index != -1) {
                RemoveAt(index);
            }
        }
        

Usage Example

Esempio n. 1
0
 public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
 {
    PropertyDescriptor pd;
    var pdc = new PropertyDescriptorCollection(base.GetProperties(attributes).Cast<PropertyDescriptor>().ToArray());
    if ((pd = pdc.Find("Source", false)) != null)
    {
       pdc.Add(TypeDescriptor.CreateProperty(typeof(Binding), pd, new Attribute[] { new DefaultValueAttribute("null") }));
       pdc.Remove(pd);
    }
    return pdc;
 }
All Usage Examples Of System.ComponentModel.PropertyDescriptorCollection::Remove