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

GetEvents() public static method

public static GetEvents ( object component, Attribute attributes, bool noCustomTypeDesc ) : EventDescriptorCollection
component object
attributes System.Attribute
noCustomTypeDesc bool
return EventDescriptorCollection
        public static EventDescriptorCollection GetEvents(object component, Attribute[] attributes, bool noCustomTypeDesc) {
            if (component == null) {
                return new EventDescriptorCollection(null, true);
            }

            if (System.Runtime.InteropServices.Marshal.IsComObject(component)) {
                
                // Do not rip this varible -- it is here to make the get to 
                // this static variable thread-safe.
                //
#pragma warning disable 618
                IComNativeDescriptorHandler handler = comNativeDescriptorHandler;
#pragma warning restore 618
                
                if (handler != null) {
                    return handler.GetEvents(component, attributes);
                }
                return new EventDescriptorCollection(null, true);
            }

            if (!noCustomTypeDesc && component is ICustomTypeDescriptor) {
                EventDescriptorCollection events = ((ICustomTypeDescriptor)component).GetEvents(attributes);
                return GetEntry(component, component.GetType()).FilterEvents(component, attributes, events);
            }
            
            return GetEntry(component, component.GetType()).GetEvents(component, attributes, (component is ICustomTypeDescriptor));
        }

Same methods

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