When applied at the class level, the Delegate attribute specifies that a class is a delegate type and will be used for method invocations.
When applied to a method, the Delegate attribute indicates that the method is an invocation method.
Attribute Level | Generated By |
Class or method | The delegate keyword |
Delegate_attribute { u2 attribute_name_index; u4 attribute_length; u2 signature; // Present only at the class level. }
attribute_name_index
This value must be a valid index into the constant_pool table. The constant_pool entry at that index must be the CONSTANT_Utf8_info structure representing the string "Delegate".
attribute_length
This value indicates the length of this attribute, excluding the initial six bytes, and may be 0 (zero) (at method level) or two (at class level).
signature
When present, this optional value must be a valid index into the constant_pool table. The constant_pool entry at that index must be the CONSTANT_Utf8_info structure representing the signature of the invoke method.
A method marked with the delegate attribute will not be JIT-compiled or interpreted by the Microsoft VM, but will instead use a special stub.
Delegate Class
MulticastDelegate Class
MulticastDelegate Attribute