TypeBuilder.GetEvent(String, BindingFlags) Método

Definición

Devuelve el evento con el nombre especificado.

C#
public override System.Reflection.EventInfo? GetEvent(string name, System.Reflection.BindingFlags bindingAttr);
C#
public override System.Reflection.EventInfo GetEvent(string name, System.Reflection.BindingFlags bindingAttr);

Parámetros

name
String

Nombre del evento que se va a buscar.

bindingAttr
BindingFlags

Combinación bit a bit de valores BindingFlags que limita la búsqueda.

Devoluciones

Objeto EventInfo que representa el evento declarado o heredado por este tipo con el nombre especificado, o null si no hay ninguna coincidencia.

Excepciones

Este método no se implementa para tipos incompletos.

Comentarios

Recupere el tipo mediante Type.GetType o Assembly.GetType y use la reflexión en el tipo recuperado.

Se aplica a

Produto Versións
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1