TypeDescriptor.GetEvents Method
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 collection of events for a component or type.
GetEvents(Object) |
Returns the collection of events for the specified component. |
GetEvents(Type) |
Returns the collection of events for a specified type of component. |
GetEvents(Object, Attribute[]) |
Returns the collection of events for a specified component using a specified array of attributes as a filter. |
GetEvents(Object, Boolean) |
Returns the collection of events for a specified component with a custom type descriptor. |
GetEvents(Type, Attribute[]) |
Returns the collection of events for a specified type of component using a specified array of attributes as a filter. |
GetEvents(Object, Attribute[], Boolean) |
Returns the collection of events for a specified component using a specified array of attributes as a filter and using a custom type descriptor. |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for the specified component.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component);
public static System.ComponentModel.EventDescriptorCollection GetEvents (object component);
static member GetEvents : obj -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object) As EventDescriptorCollection
Parameters
- component
- Object
A component to get the events for.
Returns
An EventDescriptorCollection with the events for this component.
Exceptions
component
is a cross-process remoted object.
Examples
For an example of this method, see the Count property.
Remarks
Retrieves a collection of events that the given component
parameter instance provides. This collection can differ from the set of events the class provides. If the component
parameter is sited, the site can add or remove additional events.
If component
is null
, then an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for a specified type of component.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(Type ^ componentType);
public static System.ComponentModel.EventDescriptorCollection GetEvents (Type componentType);
static member GetEvents : Type -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (componentType As Type) As EventDescriptorCollection
Parameters
Returns
An EventDescriptorCollection with the events for this component.
Remarks
Call this version of this method only when you do not have an instance of the object.
If the componentType
parameter is null
, an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for a specified component using a specified array of attributes as a filter.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.EventDescriptorCollection GetEvents (object component, Attribute[] attributes);
static member GetEvents : obj * Attribute[] -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, attributes As Attribute()) As EventDescriptorCollection
Parameters
- component
- Object
A component to get the events for.
Returns
An EventDescriptorCollection with the events that match the specified attributes for this component.
Exceptions
component
is a cross-process remoted object.
Remarks
The events for the component
parameter can differ from the events of a class, because the site can add or remove events if the component
parameter is sited.
The attributes
array can have a mix of Type and Attribute objects. Filtering is defined by the following rules:
A Type is treated as a wildcard; it matches any event that has the Type in its set of attributes.
If an event does not have an Attribute of the same class, the event is not included in the returned array.
If the attribute is an instance of the Attribute class, the event must be an exact match or it is not included in the returned array.
If an Attribute instance is specified and it is the default event, it is included in the returned array even if there is no instance of the Attribute in the event.
If component
is null
, an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for a specified component with a custom type descriptor.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptorCollection GetEvents (object component, bool noCustomTypeDesc);
static member GetEvents : obj * bool -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, noCustomTypeDesc As Boolean) As EventDescriptorCollection
Parameters
- component
- Object
A component to get the events for.
- noCustomTypeDesc
- Boolean
true
to not consider custom type description information; otherwise, false
.
Returns
An EventDescriptorCollection with the events for this component.
Exceptions
component
is a cross-process remoted object.
Remarks
This method retrieves a collection of events that the given component
parameter instance provides. This can differ from the set of events the class provides. If the component
parameter is sited, the site can add or remove additional events.
If component
is null
, an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- ICustomTypeDescriptor
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for a specified type of component using a specified array of attributes as a filter.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(Type ^ componentType, cli::array <Attribute ^> ^ attributes);
public static System.ComponentModel.EventDescriptorCollection GetEvents (Type componentType, Attribute[] attributes);
static member GetEvents : Type * Attribute[] -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (componentType As Type, attributes As Attribute()) As EventDescriptorCollection
Parameters
Returns
An EventDescriptorCollection with the events that match the specified attributes for this component.
Remarks
Call this version of this method only when you do not have an instance of the object.
The attributes
parameter array can have a mix of Type and Attribute objects. Filtering is defined by the following rules:
A Type is treated as a wildcard; it matches any event that has the Type in its set of attributes.
If an event does not have an Attribute of the same class, the event is not included in the returned array.
If the attribute is an instance of the Attribute class, the event must be an exact match or it is not included in the returned array.
If an Attribute instance is specified and it is the default event, it is included in the returned array even if there is no instance of the Attribute in the event.
If the componentType
parameter is null
, an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
- Source:
- TypeDescriptor.cs
Returns the collection of events for a specified component using a specified array of attributes as a filter and using a custom type descriptor.
public:
static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, cli::array <Attribute ^> ^ attributes, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptorCollection GetEvents (object component, Attribute[] attributes, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptorCollection GetEvents (object component, Attribute[]? attributes, bool noCustomTypeDesc);
static member GetEvents : obj * Attribute[] * bool -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, attributes As Attribute(), noCustomTypeDesc As Boolean) As EventDescriptorCollection
Parameters
- component
- Object
A component to get the events for.
- noCustomTypeDesc
- Boolean
true
to not consider custom type description information; otherwise, false
.
Returns
An EventDescriptorCollection with the events that match the specified attributes for this component.
Exceptions
component
is a cross-process remoted object.
Remarks
The events for the component
parameter can differ from the events of a class, because the site can add or remove events if the component
parameter is sited.
The attributes
parameter array can have a mix of Type and Attribute objects. Filtering is defined by the following rules:
A Type is treated as a wildcard; it matches any event that has the Type in its set of attributes.
If an event does not have an Attribute of the same class, the event is not included in the returned array.
If the attribute is an instance of the Attribute class, the event must be an exact match or it is not included in the returned array.
If an Attribute instance is specified and it is the default event, it is included in the returned array even if there is no instance of the Attribute in the event.
If component
is null
, an empty collection is returned.
The order of the returned collection is not guaranteed to be identical between calls, so always order it before use.
See also
- EventDescriptor
- EventDescriptorCollection
- ICustomTypeDescriptor
- GetEvents
- GetDefaultEvent
- CreateEvent
- GetAttributes
- GetProperties
Applies to
.NET 9 والإصدارات الأخرى
منتج | الإصدارات |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
ملاحظات .NET
.NET هو مشروع مصدر مفتوح. حدد رابطًا لتقديم الملاحظات: