System.ComponentModel.TypeDescriptor.GetEvents C# (CSharp) Method

GetEvents() public static method

Gets a collection of events for a specified type of component.
public static GetEvents ( Type componentType ) : EventDescriptorCollection
componentType System.Type
return EventDescriptorCollection
        public static EventDescriptorCollection GetEvents(Type componentType)
        {
            if (componentType == null)
            {
                Debug.Fail("COMPAT:  Returning an empty collection, but you should not pass null here");
                return new EventDescriptorCollection(null, true);
            }

            return GetDescriptor(componentType, "componentType").GetEvents();
        }

Same methods

TypeDescriptor::GetEvents ( Type componentType, Attribute attributes ) : EventDescriptorCollection
TypeDescriptor::GetEvents ( object component ) : EventDescriptorCollection
TypeDescriptor::GetEvents ( object component, Attribute attributes ) : EventDescriptorCollection
TypeDescriptor::GetEvents ( object component, Attribute attributes, bool noCustomTypeDesc ) : EventDescriptorCollection
TypeDescriptor::GetEvents ( object component, bool noCustomTypeDesc ) : EventDescriptorCollection

Usage Example

Example #1
0
 public EventDescriptorCollection GetEvents(Attribute[] attributes) => NativeTypeDesc.GetEvents(attributes, true);
All Usage Examples Of System.ComponentModel.TypeDescriptor::GetEvents