Delegate(Object)

The delegate object represents a function call that will be executed by an event. However, the function can be passed parameters and you can declare what what the calling object will be. Also, delegates can be individually disabled to prevent their execution. Below is how you would set up a delegate.

 

Constructors

Delegate(Function func) Creates a delegate that just calls the function.
Delegate(Function func, Object callingObject) Creates a delegate that will call the function as if the callingObject initiated the call.
Delegate(Function func, Object callingObject, params…) Creates a delegate that will call the function as if the callingObject initiated the call. The provided objects as params  will be passed to the function as parameters in the order they are provided.

 

Static Fields

Event Object This is a placeholder object that can be used to in the params portion of the delegate that be replaced with the current EventArgs during the function call.

Fields

Enabled Boolean If not enabled, the delegate will not be called during events.
Parameters Array An array of parameters that will be passed to the function when the delegate is invoked.
This Object The object that will act as the caller when an event occurs.

Functions

Execute()   Fires the delegate.

Last edited May 29, 2011 at 9:29 PM by dahrkdaiz, version 4

Comments

No comments yet.