Share via


SnapInBase.Invoke Method (Delegate, Object[])

 

Executes the delegate on the main thread that the snap-in executes on.

Namespace:   Microsoft.ManagementConsole
Assembly:  Microsoft.ManagementConsole (in Microsoft.ManagementConsole.dll)

Syntax

public object Invoke(
    Delegate method,
    object[] args
)
public:
virtual Object^ Invoke(
    Delegate^ method,
    array<Object^>^ args
) sealed
abstract Invoke : 
        method:Delegate *
        args:Object[] -> Object
override Invoke : 
        method:Delegate *
        args:Object[] -> Object
Public Function Invoke (
    method As Delegate,
    args As Object()
) As Object

Parameters

  • method
    Type: System.Delegate

    A delegate to a method that uses parameters of the number and type that is specified in the args parameter.

  • args
    Type: System.Object[]

    An array of objects to pass as arguments to the given method. This parameter can be null if no arguments are needed.

Return Value

Type: System.Object

A return value from the delegate being invoked; null if the delegate has no return value.

Implements

ISynchronizeInvoke.Invoke(Delegate, Object[])

Remarks

This method is used when a snap-in component or other code that is related to a snap-in needs to be called on the same thread that the snap-in was created on.

The method blocks until the call has been completed.

See Also

Invoke Overload
SnapInBase Class
Microsoft.ManagementConsole Namespace

Return to top