Ler em inglês

Partilhar via


TypeBuilder.GetEvent(String, BindingFlags) Método

Definição

Retorna o evento com o nome 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

O nome do evento a ser pesquisado.

bindingAttr
BindingFlags

Uma combinação bit a bit de valores BindingFlags que limita a pesquisa.

Retornos

Um objeto EventInfo que representa o evento declarado ou herdado por esse tipo com o nome especificado ou null se não houver correspondências.

Exceções

Esse método não está implementado para tipos incompletos.

Comentários

Recupere o tipo usando Type.GetType ou Assembly.GetType e use reflexão no tipo recuperado.

Aplica-se a

Produto Versões
.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