TypeBuilder.GetEvent(String, BindingFlags) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Devolve o evento com o nome especificado.
public:
override System::Reflection::EventInfo ^ GetEvent(System::String ^ name, System::Reflection::BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo? GetEvent(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);
[<System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembers(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)>]
override this.GetEvent : string * System.Reflection.BindingFlags -> System.Reflection.EventInfo
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 procurar.
- bindingAttr
- BindingFlags
Uma combinação bit a bit de BindingFlags valores que limita a pesquisa.
Devoluções
Um EventInfo objeto que representa o evento declarado ou herdado por este tipo com o nome especificado, ou null se não houver correspondências.
- Atributos
Exceções
Este método não é implementado para tipos incompletos.
Observações
Recupere o tipo usando Type.GetType ou Assembly.GetType e use reflexão sobre o tipo recuperado.