TypeBuilder.GetEvent(String, BindingFlags) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns the event with the specified name.
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
Parameters
- name
- String
The name of the event to search for.
- bindingAttr
- BindingFlags
A bitwise combination of BindingFlags values that limits the search.
Returns
An EventInfo object representing the event declared or inherited by this type with the specified name, or null
if there are no matches.
Exceptions
This method is not implemented for incomplete types.
Remarks
Retrieve the type using Type.GetType or Assembly.GetType and use reflection on the retrieved type.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för