TypeBuilder.GetEvent(String, BindingFlags) Método

Definição

Retorna o evento com o nome especificado.

public:
 override System::Reflection::EventInfo ^ GetEvent(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
public override System.Reflection.EventInfo? GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
public override System.Reflection.EventInfo GetEvent (string name, System.Reflection.BindingFlags bindingAttr);
override this.GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
Public Overrides Function GetEvent (name As String, bindingAttr As BindingFlags) As EventInfo

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