TypeBuilder.GetEvent(String, BindingFlags) Método

Definição

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.

Aplica-se a