Combine Method (Delegate, Delegate)
Collapse the table of content
Expand the table of content

Delegate.Combine Method (Delegate, Delegate)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Concatenates the invocation lists of two delegates.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function Combine ( _
	a As Delegate, _
	b As Delegate _
) As Delegate

Parameters

a
Type: System.Delegate
The delegate whose invocation list comes first.
b
Type: System.Delegate
The delegate whose invocation list comes last.

Return Value

Type: System.Delegate
A new delegate with an invocation list that concatenates the invocation lists of a and b in that order. Returns a if b is Nothing, returns b if a is a null reference, and returns a null reference if both a and b are null references.

ExceptionCondition
ArgumentException

Both a and b are not Nothing, and a and b are not instances of the same delegate type.

MethodAccessException

Application code attempts to access this member late-bound, for example, by using the Type.InvokeMember method.

The invocation list can contain duplicate entries; that is, entries that refer to the same method on the same object.

Combine is useful for creating event handlers that call multiple methods each time an event occurs.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft