System.ComponentModel.EventDescriptorCollection.Add C# (CSharp) Method

Add() public method

public Add ( System.ComponentModel.EventDescriptor value ) : int
value System.ComponentModel.EventDescriptor
return int
        public int Add(EventDescriptor value) {
            if (readOnly) {
                throw new NotSupportedException();
            }

            EnsureSize(eventCount + 1);
            events[eventCount++] = value;
            return eventCount - 1;
        }
        

Usage Example

Example #1
0
 public static EventDescriptorCollection GetEvents
     (Type componentType, Attribute[] attributes)
 {
     lock (typeof(TypeDescriptor))
     {
         TypeElement element = GetOrCreateElement(componentType);
         if (element.events != null)
         {
             return(element.events);
         }
         EventDescriptorCollection coll;
         coll = new EventDescriptorCollection(null);
         foreach (EventInfo eventInfo in componentType.GetEvents())
         {
             coll.Add(new BuiltinEventDescriptor
                          (eventInfo, attributes));
         }
         element.events = coll;
         return(coll);
     }
 }
All Usage Examples Of System.ComponentModel.EventDescriptorCollection::Add