NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

7.9 Delegates

A delegate is a reference type that refers to a shared method of a type or to an instance method of an object. The closest equivalent of a delegate in other languages is a function pointer, but whereas a function pointer can only reference shared functions, a delegate can reference both shared and instance methods. In the latter case, the delegate stores not only a reference to the method's entry point, but also a reference to the object instance with which to invoke the method.

Any attributes specified in the method declaration apply to the delegate itself. The method declaration may not have a body or an End construct. The accessibility domain of the return type and parameter types must be the same as or a superset of the accessibility domain of the delegate itself.

The members of a delegate are the members inherited from class System.Delegate. A delegate also contains a set of constructors and methods defined by the system. As these are specified and implemented by the NGWS Runtime, they are not listed here.

DelegateTypeName ::= QualifiedIdentifier
DelegateTypeDeclaration ::=
 [ DelegateModifier+ ] Delegate ProcedureDeclaration
DelegateModifier ::= AccessModifier | ShadowsModifier