DotNetObject.AddDelegateToEvent

Associate a delegate with an event

WSupported on Windows

 

 

 

object.AddDelegateToEvent(eventname, delegate)

Arguments

object

One of the following:

eventname

The name of the event to add the delegate to.

delegate

A delegate returned from the DotNetDelegate constructor.

Discussion

The order in which delegates are called by .NET is determined by .NET rules (usually first in, first out). A delegate should not contain any user interface components and should be implemented with the same limitations as xfServerPlus calls.

Examples

The second line of the example below associates an instance of the System.EventHandler delegate named button_OnClick with the Click event. See Sample programs for an example in the context of a complete program.

button_OnClick = new DotNetDelegate(sys, "System.EventHandler", ^NULL,
    &  "ns1.cls1.static_meth1")
button.AddDelegateToEvent("Click", button_OnClick)