TypeDescriptor.GetDefaultEvent Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the default event for a component or type.
Overloads
| GetDefaultEvent(Object) |
Returns the default event for the specified component. |
| GetDefaultEvent(Type) |
Returns the default event for the specified type of component. |
| GetDefaultEvent(Object, Boolean) |
Returns the default event for a component with a custom type descriptor. |
GetDefaultEvent(Object)
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the default event for the specified component.
public:
static System::ComponentModel::EventDescriptor ^ GetDefaultEvent(System::Object ^ component);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptor? GetDefaultEvent(object component);
public static System.ComponentModel.EventDescriptor GetDefaultEvent(object component);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")>]
static member GetDefaultEvent : obj -> System.ComponentModel.EventDescriptor
static member GetDefaultEvent : obj -> System.ComponentModel.EventDescriptor
Public Shared Function GetDefaultEvent (component As Object) As EventDescriptor
Parameters
- component
- Object
The component to get the event for.
Returns
An EventDescriptor with the default event, or null if there are no events.
- Attributes
Exceptions
component is null.
component is a cross-process remoted object.
Remarks
This method is equivalent to the overloaded GetDefaultEvent(Object, Boolean) method with a second parameter of false.
See also
- DefaultEventAttribute
- EventDescriptor
- GetDefaultEvent()
- GetEvents
- CreateEvent
- GetAttributes
- GetProperties
- GetDefaultProperty
Applies to
GetDefaultEvent(Type)
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the default event for the specified type of component.
public:
static System::ComponentModel::EventDescriptor ^ GetDefaultEvent(Type ^ componentType);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")]
public static System.ComponentModel.EventDescriptor? GetDefaultEvent(Type componentType);
public static System.ComponentModel.EventDescriptor GetDefaultEvent(Type componentType);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code.")>]
static member GetDefaultEvent : Type -> System.ComponentModel.EventDescriptor
static member GetDefaultEvent : Type -> System.ComponentModel.EventDescriptor
Public Shared Function GetDefaultEvent (componentType As Type) As EventDescriptor
Parameters
Returns
An EventDescriptor with the default event, or null if there are no events.
- Attributes
Exceptions
componentType is null.
Remarks
Call this version of this method only when you do not have an instance of the object.
See also
- DefaultEventAttribute
- EventDescriptor
- GetDefaultEvent()
- GetEvents
- CreateEvent
- GetAttributes
- GetProperties
- GetDefaultProperty
Applies to
GetDefaultEvent(Object, Boolean)
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the default event for a component with a custom type descriptor.
public:
static System::ComponentModel::EventDescriptor ^ GetDefaultEvent(System::Object ^ component, bool noCustomTypeDesc);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptor? GetDefaultEvent(object component, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptor GetDefaultEvent(object component, bool noCustomTypeDesc);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The built-in EventDescriptor implementation uses Reflection which requires unreferenced code. The Type of component cannot be statically discovered.")>]
static member GetDefaultEvent : obj * bool -> System.ComponentModel.EventDescriptor
static member GetDefaultEvent : obj * bool -> System.ComponentModel.EventDescriptor
Public Shared Function GetDefaultEvent (component As Object, noCustomTypeDesc As Boolean) As EventDescriptor
Parameters
- component
- Object
The component to get the event for.
- noCustomTypeDesc
- Boolean
true to not consider custom type description information; otherwise, false.
Returns
An EventDescriptor with the default event, or null if there are no events.
- Attributes
Exceptions
component is null.
component is a cross-process remoted object.
See also
- DefaultEventAttribute
- EventDescriptor
- ICustomTypeDescriptor
- GetDefaultEvent()
- GetEvents
- CreateEvent
- GetAttributes
- GetProperties
- GetDefaultProperty