TypeDescriptor.GetEvents Metod

Definition

Returnerar samlingen med händelser för en komponent eller typ.

Överlagringar

Name Description
GetEvents(Object)

Returnerar samlingen med händelser för den angivna komponenten.

GetEvents(Type)

Returnerar samlingen med händelser för en angiven typ av komponent.

GetEvents(Object, Attribute[])

Returnerar samlingen med händelser för en angiven komponent med en angiven matris med attribut som ett filter.

GetEvents(Object, Boolean)

Returnerar samlingen med händelser för en angiven komponent med en anpassad typbeskrivning.

GetEvents(Type, Attribute[])

Returnerar samlingen med händelser för en angiven typ av komponent med en angiven matris med attribut som ett filter.

GetEvents(Object, Attribute[], Boolean)

Returnerar samlingen med händelser för en angiven komponent med en angiven matris med attribut som ett filter och med hjälp av en anpassad typbeskrivning.

GetEvents(Object)

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för den angivna komponenten.

public:
 static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component);
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")>]
static member GetEvents : obj -> System.ComponentModel.EventDescriptorCollection
static member GetEvents : obj -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object) As EventDescriptorCollection

Parametrar

component
Object

En komponent att hämta händelserna för.

Returer

En EventDescriptorCollection med händelserna för den här komponenten.

Attribut

Undantag

component är ett fjärrobjekt mellan processer.

Exempel

Ett exempel på den här metoden finns i egenskapen Count .

Kommentarer

Hämtar en samling händelser som den angivna component parameterinstansen tillhandahåller. Den här samlingen kan skilja sig från den uppsättning händelser som klassen tillhandahåller. Om parametern component är platsad kan webbplatsen lägga till eller ta bort ytterligare händelser.

Om component är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för

GetEvents(Type)

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för en angiven typ av komponent.

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

Parametrar

componentType
Type

Målkomponentens Type .

Returer

En EventDescriptorCollection med händelserna för den här komponenten.

Kommentarer

Anropa endast den här versionen av den här metoden när du inte har någon instans av objektet.

Om parametern componentType är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för

GetEvents(Object, Attribute[])

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för en angiven komponent med en angiven matris med attribut som ett filter.

public:
 static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, cli::array <Attribute ^> ^ attributes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, Attribute[] attributes);
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, Attribute[] attributes);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")>]
static member GetEvents : obj * Attribute[] -> System.ComponentModel.EventDescriptorCollection
static member GetEvents : obj * Attribute[] -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, attributes As Attribute()) As EventDescriptorCollection

Parametrar

component
Object

En komponent att hämta händelserna för.

attributes
Attribute[]

En matris av typen Attribute som du kan använda som ett filter.

Returer

Ett EventDescriptorCollection med de händelser som matchar de angivna attributen för den här komponenten.

Attribut

Undantag

component är ett fjärrobjekt mellan processer.

Kommentarer

Händelserna för parametern component kan skilja sig från händelserna i en klass, eftersom platsen kan lägga till eller ta bort händelser om parametern component är platsad.

Matrisen attributes kan ha en blandning av Type och Attribute objekt. Filtrering definieras av följande regler:

  • A Type behandlas som ett jokertecken. Det matchar alla händelser som har Type i sin uppsättning attribut.

  • Om en händelse inte har en Attribute av samma klass inkluderas inte händelsen i den returnerade matrisen.

  • Om attributet är en instans av Attribute klassen måste händelsen vara en exakt matchning eller så ingår den inte i den returnerade matrisen.

  • Om en Attribute instans har angetts och det är standardhändelsen inkluderas den i den returnerade matrisen även om det inte finns någon instans av Attribute händelsen.

Om component är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för

GetEvents(Object, Boolean)

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för en angiven komponent med en anpassad typbeskrivning.

public:
 static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, bool noCustomTypeDesc);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, bool noCustomTypeDesc);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered.")>]
static member GetEvents : obj * bool -> System.ComponentModel.EventDescriptorCollection
static member GetEvents : obj * bool -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, noCustomTypeDesc As Boolean) As EventDescriptorCollection

Parametrar

component
Object

En komponent att hämta händelserna för.

noCustomTypeDesc
Boolean

trueför att inte ta hänsyn till information om beskrivning av anpassad typ. annars . false

Returer

En EventDescriptorCollection med händelserna för den här komponenten.

Attribut

Undantag

component är ett fjärrobjekt mellan processer.

Kommentarer

Den här metoden hämtar en samling händelser som den angivna component parameterinstansen tillhandahåller. Detta kan skilja sig från den uppsättning händelser som klassen tillhandahåller. Om parametern component är platsad kan webbplatsen lägga till eller ta bort ytterligare händelser.

Om component är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för

GetEvents(Type, Attribute[])

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för en angiven typ av komponent med en angiven matris med attribut som ett filter.

public:
 static System::ComponentModel::EventDescriptorCollection ^ GetEvents(Type ^ componentType, cli::array <Attribute ^> ^ attributes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(Type componentType, Attribute[] attributes);
public static System.ComponentModel.EventDescriptorCollection GetEvents(Type componentType, Attribute[] attributes);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")>]
static member GetEvents : Type * Attribute[] -> System.ComponentModel.EventDescriptorCollection
static member GetEvents : Type * Attribute[] -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (componentType As Type, attributes As Attribute()) As EventDescriptorCollection

Parametrar

componentType
Type

Målkomponentens Type .

attributes
Attribute[]

En matris av typen Attribute som du kan använda som ett filter.

Returer

Ett EventDescriptorCollection med de händelser som matchar de angivna attributen för den här komponenten.

Attribut

Kommentarer

Anropa endast den här versionen av den här metoden när du inte har någon instans av objektet.

Parametermatrisen attributes kan ha en blandning av Type och Attribute objekt. Filtrering definieras av följande regler:

  • A Type behandlas som ett jokertecken. Det matchar alla händelser som har Type i sin uppsättning attribut.

  • Om en händelse inte har en Attribute av samma klass inkluderas inte händelsen i den returnerade matrisen.

  • Om attributet är en instans av Attribute klassen måste händelsen vara en exakt matchning eller så ingår den inte i den returnerade matrisen.

  • Om en Attribute instans har angetts och det är standardhändelsen inkluderas den i den returnerade matrisen även om det inte finns någon instans av Attribute händelsen.

Om parametern componentType är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för

GetEvents(Object, Attribute[], Boolean)

Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs
Källa:
TypeDescriptor.cs

Returnerar samlingen med händelser för en angiven komponent med en angiven matris med attribut som ett filter och med hjälp av en anpassad typbeskrivning.

public:
 static System::ComponentModel::EventDescriptorCollection ^ GetEvents(System::Object ^ component, cli::array <Attribute ^> ^ attributes, bool noCustomTypeDesc);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")]
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, Attribute[]? attributes, bool noCustomTypeDesc);
public static System.ComponentModel.EventDescriptorCollection GetEvents(object component, Attribute[] attributes, bool noCustomTypeDesc);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of component cannot be statically discovered. The public parameterless constructor or the 'Default' static field may be trimmed from the Attribute's Type.")>]
static member GetEvents : obj * Attribute[] * bool -> System.ComponentModel.EventDescriptorCollection
static member GetEvents : obj * Attribute[] * bool -> System.ComponentModel.EventDescriptorCollection
Public Shared Function GetEvents (component As Object, attributes As Attribute(), noCustomTypeDesc As Boolean) As EventDescriptorCollection

Parametrar

component
Object

En komponent att hämta händelserna för.

attributes
Attribute[]

En matris av typen Attribute som ska användas som ett filter.

noCustomTypeDesc
Boolean

trueför att inte ta hänsyn till information om beskrivning av anpassad typ. annars . false

Returer

Ett EventDescriptorCollection med de händelser som matchar de angivna attributen för den här komponenten.

Attribut

Undantag

component är ett fjärrobjekt mellan processer.

Kommentarer

Händelserna för parametern component kan skilja sig från händelserna i en klass, eftersom platsen kan lägga till eller ta bort händelser om parametern component är platsad.

Parametermatrisen attributes kan ha en blandning av Type och Attribute objekt. Filtrering definieras av följande regler:

  • A Type behandlas som ett jokertecken. Det matchar alla händelser som har Type i sin uppsättning attribut.

  • Om en händelse inte har en Attribute av samma klass inkluderas inte händelsen i den returnerade matrisen.

  • Om attributet är en instans av Attribute klassen måste händelsen vara en exakt matchning eller så ingår den inte i den returnerade matrisen.

  • Om en Attribute instans har angetts och det är standardhändelsen inkluderas den i den returnerade matrisen även om det inte finns någon instans av Attribute händelsen.

Om component är nullreturneras en tom samling.

Ordningen på den returnerade samlingen är inte garanterad att vara identisk mellan anrop, så beställ den alltid före användning.

Se även

Gäller för