ComponentExtensionsGetEvent Method
Gets a EventInfo that match the specified event name
declared in the source Component.
Namespace: DevCase.Extensions.ComponentExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[EditorBrowsableAttribute(EditorBrowsableState.Always)]
public static EventInfo GetEvent(
this Component component,
string eventName,
bool declaredOnly
)
<ExtensionAttribute>
<EditorBrowsableAttribute(EditorBrowsableState.Always)>
Public Shared Function GetEvent (
component As Component,
eventName As String,
declaredOnly As Boolean
) As EventInfo
Dim component As Component
Dim eventName As String
Dim declaredOnly As Boolean
Dim returnValue As EventInfo
returnValue = component.GetEvent(eventName,
declaredOnly)
public:
[ExtensionAttribute]
[EditorBrowsableAttribute(EditorBrowsableState::Always)]
static EventInfo^ GetEvent(
Component^ component,
String^ eventName,
bool declaredOnly
)
[<ExtensionAttribute>]
[<EditorBrowsableAttribute(EditorBrowsableState.Always)>]
static member GetEvent :
component : Component *
eventName : string *
declaredOnly : bool -> EventInfo
No code example is currently available or this language may not be supported.
- component Component
-
The source Component.
- eventName String
-
The name of the event.
- declaredOnly Boolean
-
If , only events declared at the
level of the supplied type's hierarchy should be considered.
Inherited events are not considered.
EventInfo
The resulting
EventInfoIn Visual Basic and C#, you can call this method as an instance method on any object of type
Component. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This is a code example.
No code example is currently available or this language may not be supported.
Dim ctrl As New Button()
Dim ev As EventInfo
Try
ev = ctrl.GetEvent(NameOf(Button.MouseDoubleClick), declaredOnly:=True)
Console.WriteLine($"Event Name: {ev.Name}")
Catch ex As InvalidOperationException
Console.WriteLine($"No event found matching the supplied name: {ev.Name}")
End Try
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
ArgumentException
|
No event found matching the supplied name: {eventName},
|