Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

7.5.5.2 Delegate invocations

Visual Studio .NET 2003

For a delegate invocation, the primary-expression of the invocation-expression must be a value of a delegate-type. Furthermore, considering the delegate-type to be a function member with the same parameter list as the delegate-type, the delegate-type must be applicable (Section 7.4.2.1) with respect to the argument-list of the invocation-expression.

The run-time processing of a delegate invocation of the form D(A), where D is a primary-expression of a delegate-type and A is an optional argument-list, consists of the following steps:

  • D is evaluated. If this evaluation causes an exception, no further steps are executed.
  • The value of D is checked to be valid. If the value of D is null, a System.NullReferenceException is thrown and no further steps are executed.
  • Otherwise, D is a reference to a delegate instance. Function member invocations (Section 7.4.3) are performed on each of the callable entities in the invocation list of the delegate. For callable entities consisting of an instance and instance method, the instance for the invocation is the instance contained in the callable entity.
Show:
© 2015 Microsoft