DhStyleBase.invoke

Overview | Methods | Fields | This Package | All Packages

DhStyleBase.invoke

Executes the specified delegate on the thread that owns this element's underlying peer.

Syntax

public final Object invoke( Delegate method )

public final Object invoke( Delegate method, Object args[] )

Parameters

method

A delegate that contains the method to be called in the element's thread context. The delegate can be an EventHandler object, in which case the sender parameter will contain this element, and the event parameter will contain Event.EMPTY. The delegate can also be a MethodInvoker object or any other delegate that takes a void parameter list. A call to an EventHandler or MethodInvoker delegate is faster than a call to another type of delegate. When using the form of invoke that takes an args parameter, this delegate must point to a method that contains the same number and type of arguments specified in args.  

args

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

Return Value

Returns the return value of the invoked delegate; returns null if the delegate has no return value.

Exceptions

WFCSystemException thrown if the element's thread is blocked.

Remarks

Exceptions that are raised during the call are propagated back to the caller.