ControlExtensionsSafeBeginInvoke(Control, Action) Method
Safely executes the specified
Action delegate asynchronously
on the thread that owns the source control's underlying window handle.
This method automatically determines if the caller must call
BeginInvoke(Delegate) method when making
method calls to the source control on a different thread than the
one the control was created on.
Namespace: DevCase.Extensions.ControlExtensionsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IAsyncResult SafeBeginInvoke(
this Control control,
Action method
)
<ExtensionAttribute>
Public Shared Function SafeBeginInvoke (
control As Control,
method As Action
) As IAsyncResult
Dim control As Control
Dim method As Action
Dim returnValue As IAsyncResult
returnValue = control.SafeBeginInvoke(method)
public:
[ExtensionAttribute]
static IAsyncResult^ SafeBeginInvoke(
Control^ control,
Action^ method
)
[<ExtensionAttribute>]
static member SafeBeginInvoke :
control : Control *
method : Action -> IAsyncResult
No code example is currently available or this language may not be supported.
- control Control
-
The control on which to invoke the delegate asynchronously.
- method Action
-
An Action delegate that contains a method that takes no parameters
and that is to be called in the control's thread context.
IAsyncResult
An
IAsyncResult that represents the result of the BeginInvoke operation.
In Visual Basic and C#, you can call this method as an instance method on any object of type
Control. 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).