ExtensionsInvokeIfRequired Method |
Runs the provided action on the SynchronizationContext if one is provided otherwise runs the action on the current thread
Namespace: ParticleAssembly: Particle (in Particle.dll) Version: 0.8.5.14 (0.8.5.14)
Syntaxpublic static void InvokeIfRequired(
this SynchronizationContext context,
Action action
)
<ExtensionAttribute>
Public Shared Sub InvokeIfRequired (
context As SynchronizationContext,
action As Action
)
public:
[ExtensionAttribute]
static void InvokeIfRequired(
SynchronizationContext^ context,
Action^ action
)
[<ExtensionAttribute>]
static member InvokeIfRequired :
context : SynchronizationContext *
action : Action -> unit
Parameters
- context
- Type: System.ThreadingSynchronizationContext
The SynchronizationContext. - action
- Type: SystemAction
The action to run
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
SynchronizationContext. 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).
See Also