mscorlib(4.0.0.0) API with additions
System.Delegate Class Reference

Represents a delegate, which is a data structure that refers to a static method or to a class instance and an instance method of that class. More...

Inheritance diagram for System.Delegate:
[legend]
Collaboration diagram for System.Delegate:
[legend]

Public Member Functions

object DynamicInvoke (params object[] args)
 Dynamically invokes (late-bound) the method represented by the current delegate. More...
 
override bool Equals (object obj)
 Determines whether the specified object and the current delegate are of the same type and share the same targets, methods, and invocation list. More...
 
override int GetHashCode ()
 Returns a hash code for the delegate. More...
 
virtual Delegate [] GetInvocationList ()
 Returns the invocation list of the delegate. More...
 
virtual object Clone ()
 Creates a shallow copy of the delegate. More...
 
virtual void GetObjectData (SerializationInfo info, StreamingContext context)
 Not supported. More...
 

Static Public Member Functions

static Delegate Combine (Delegate a, Delegate b)
 Concatenates the invocation lists of two delegates. More...
 
static Delegate Combine (params Delegate[] delegates)
 Concatenates the invocation lists of an array of delegates. More...
 
static Delegate Remove (Delegate source, Delegate value)
 Removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate. More...
 
static Delegate RemoveAll (Delegate source, Delegate value)
 Removes all occurrences of the invocation list of a delegate from the invocation list of another delegate. More...
 
static Delegate CreateDelegate (Type type, object target, string method)
 Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance. More...
 
static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase)
 Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance with the specified case-sensitivity. More...
 
static Delegate CreateDelegate (Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure)
 Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance, with the specified case-sensitivity and the specified behavior on failure to bind. More...
 
static Delegate CreateDelegate (Type type, Type target, string method)
 Creates a delegate of the specified type that represents the specified static method of the specified class. More...
 
static Delegate CreateDelegate (Type type, Type target, string method, bool ignoreCase)
 Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity. More...
 
static Delegate CreateDelegate (Type type, Type target, string method, bool ignoreCase, bool throwOnBindFailure)
 Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity and the specified behavior on failure to bind. More...
 
static Delegate CreateDelegate (Type type, MethodInfo method, bool throwOnBindFailure)
 Creates a delegate of the specified type to represent the specified static method, with the specified behavior on failure to bind. More...
 
static Delegate CreateDelegate (Type type, object firstArgument, MethodInfo method)
 Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument. More...
 
static Delegate CreateDelegate (Type type, object firstArgument, MethodInfo method, bool throwOnBindFailure)
 Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument and the specified behavior on failure to bind. More...
 
static bool operator== (Delegate d1, Delegate d2)
 Determines whether the specified delegates are equal. More...
 
static bool operator != (Delegate d1, Delegate d2)
 Determines whether the specified delegates are not equal. More...
 
static Delegate CreateDelegate (Type type, MethodInfo method)
 Creates a delegate of the specified type to represent the specified static method. More...
 

Protected Member Functions

 Delegate (object target, string method)
 Initializes a delegate that invokes the specified instance method on the specified class instance. More...
 
 Delegate (Type target, string method)
 Initializes a delegate that invokes the specified static method from the specified class. More...
 
virtual object DynamicInvokeImpl (object[] args)
 Dynamically invokes (late-bound) the method represented by the current delegate. More...
 
virtual MethodInfo GetMethodImpl ()
 Gets the static method represented by the current delegate. More...
 
virtual Delegate CombineImpl (Delegate d)
 Concatenates the invocation lists of the specified multicast (combinable) delegate and the current multicast (combinable) delegate. More...
 
virtual Delegate RemoveImpl (Delegate d)
 Removes the invocation list of a delegate from the invocation list of another delegate. More...
 

Properties

MethodInfo Method [get]
 Gets the method represented by the delegate. More...
 
object Target [get]
 Gets the class instance on which the current delegate invokes the instance method. More...
 

Detailed Description

Represents a delegate, which is a data structure that refers to a static method or to a class instance and an instance method of that class.

Definition at line 15 of file Delegate.cs.

Constructor & Destructor Documentation

◆ Delegate() [1/2]

System.Delegate.Delegate ( object  target,
string  method 
)
protected

Initializes a delegate that invokes the specified instance method on the specified class instance.

Parameters
targetThe class instance on which the delegate invokes method .
methodThe name of the instance method that the delegate represents.
Exceptions
T:System.ArgumentNullExceptiontarget is null.-or- method is null.
T:System.ArgumentExceptionThere was an error binding to the target method.

Definition at line 62 of file Delegate.cs.

◆ Delegate() [2/2]

System.Delegate.Delegate ( Type  target,
string  method 
)
protected

Initializes a delegate that invokes the specified static method from the specified class.

Parameters
targetThe T:System.Type representing the class that defines method .
methodThe name of the static method that the delegate represents.
Exceptions
T:System.ArgumentNullExceptiontarget is null.-or- method is null.
T:System.ArgumentExceptiontarget is not a RuntimeType. See Runtime Types in Reflection.-or- target represents an open generic type.

Definition at line 88 of file Delegate.cs.

Member Function Documentation

◆ Clone()

virtual object System.Delegate.Clone ( )
virtual

Creates a shallow copy of the delegate.

Returns
A shallow copy of the delegate.

Implements System.ICloneable.

Definition at line 347 of file Delegate.cs.

◆ Combine() [1/2]

static Delegate System.Delegate.Combine ( Delegate  a,
Delegate  b 
)
static

Concatenates the invocation lists of two delegates.

Parameters
aThe delegate whose invocation list comes first.
bThe delegate whose invocation list comes last.
Returns
A new delegate with an invocation list that concatenates the invocation lists of a and b in that order. Returns a if b is null, returns b if a is a null reference, and returns a null reference if both a and b are null references.
Exceptions
T:System.ArgumentExceptionBoth a and b are not null, and a and b are not instances of the same delegate type.

Definition at line 202 of file Delegate.cs.

◆ Combine() [2/2]

static Delegate System.Delegate.Combine ( params Delegate []  delegates)
static

Concatenates the invocation lists of an array of delegates.

Parameters
delegatesThe array of delegates to combine.
Returns
A new delegate with an invocation list that concatenates the invocation lists of the delegates in the delegates array. Returns null if delegates is null, if delegates contains zero elements, or if every entry in delegates is null.
Exceptions
T:System.ArgumentExceptionNot all the non-null entries in delegates are instances of the same delegate type.

Definition at line 217 of file Delegate.cs.

◆ CombineImpl()

virtual Delegate System.Delegate.CombineImpl ( Delegate  d)
protectedvirtual

Concatenates the invocation lists of the specified multicast (combinable) delegate and the current multicast (combinable) delegate.

Parameters
dThe multicast (combinable) delegate whose invocation list to append to the end of the invocation list of the current multicast (combinable) delegate.
Returns
A new multicast (combinable) delegate with an invocation list that concatenates the invocation list of the current multicast (combinable) delegate and the invocation list of d , or the current multicast (combinable) delegate if d is null.
Exceptions
T:System.MulticastNotSupportedExceptionAlways thrown.

Reimplemented in System.MulticastDelegate.

Definition at line 327 of file Delegate.cs.

◆ CreateDelegate() [1/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
object  target,
string  method 
)
static

Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance.

Parameters
typeThe T:System.Type of delegate to create.
targetThe class instance on which method is invoked.
methodThe name of the instance method that the delegate is to represent.
Returns
A delegate of the specified type that represents the specified instance method to invoke on the specified class instance.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate. -or- type is not a RuntimeType. See Runtime Types in Reflection.-or- method is not an instance method. -or- method cannot be bound, for example because it cannot be found.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 368 of file Delegate.cs.

◆ CreateDelegate() [2/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
object  target,
string  method,
bool  ignoreCase 
)
static

Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance with the specified case-sensitivity.

Parameters
typeThe T:System.Type of delegate to create.
targetThe class instance on which method is invoked.
methodThe name of the instance method that the delegate is to represent.
ignoreCaseA Boolean indicating whether to ignore the case when comparing the name of the method.
Returns
A delegate of the specified type that represents the specified instance method to invoke on the specified class instance.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection.-or- method is not an instance method. -or- method cannot be bound, for example because it cannot be found.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 390 of file Delegate.cs.

◆ CreateDelegate() [3/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
object  target,
string  method,
bool  ignoreCase,
bool  throwOnBindFailure 
)
static

Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance, with the specified case-sensitivity and the specified behavior on failure to bind.

Parameters
typeThe T:System.Type of delegate to create.
targetThe class instance on which method is invoked.
methodThe name of the instance method that the delegate is to represent.
ignoreCaseA Boolean indicating whether to ignore the case when comparing the name of the method.
throwOnBindFailuretrue to throw an exception if method cannot be bound; otherwise, false.
Returns
A delegate of the specified type that represents the specified instance method to invoke on the specified class instance.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or-

method is not an instance method. -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true.

Exceptions
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 415 of file Delegate.cs.

◆ CreateDelegate() [4/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
Type  target,
string  method 
)
static

Creates a delegate of the specified type that represents the specified static method of the specified class.

Parameters
typeThe T:System.Type of delegate to create.
targetThe T:System.Type representing the class that implements method .
methodThe name of the static method that the delegate is to represent.
Returns
A delegate of the specified type that represents the specified static method of the specified class.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType.-or- target is an open generic type. That is, its P:System.Type.ContainsGenericParameters property is true.-or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 468 of file Delegate.cs.

◆ CreateDelegate() [5/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
Type  target,
string  method,
bool  ignoreCase 
)
static

Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity.

Parameters
typeThe T:System.Type of delegate to create.
targetThe T:System.Type representing the class that implements method .
methodThe name of the static method that the delegate is to represent.
ignoreCaseA Boolean indicating whether to ignore the case when comparing the name of the method.
Returns
A delegate of the specified type that represents the specified static method of the specified class.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType.-or- target is an open generic type. That is, its P:System.Type.ContainsGenericParameters property is true.-or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 492 of file Delegate.cs.

◆ CreateDelegate() [6/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
Type  target,
string  method,
bool  ignoreCase,
bool  throwOnBindFailure 
)
static

Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity and the specified behavior on failure to bind.

Parameters
typeThe T:System.Type of delegate to create.
targetThe T:System.Type representing the class that implements method .
methodThe name of the static method that the delegate is to represent.
ignoreCaseA Boolean indicating whether to ignore the case when comparing the name of the method.
throwOnBindFailuretrue to throw an exception if method cannot be bound; otherwise, false.
Returns
A delegate of the specified type that represents the specified static method of the specified class.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- target is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType.-or- target is an open generic type. That is, its P:System.Type.ContainsGenericParameters property is true.-or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 519 of file Delegate.cs.

◆ CreateDelegate() [7/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
MethodInfo  method,
bool  throwOnBindFailure 
)
static

Creates a delegate of the specified type to represent the specified static method, with the specified behavior on failure to bind.

Parameters
typeThe T:System.Type of delegate to create.
methodThe T:System.Reflection.MethodInfo describing the static or instance method the delegate is to represent.
throwOnBindFailuretrue to throw an exception if method cannot be bound; otherwise, false.
Returns
A delegate of the specified type to represent the specified static method.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound, and throwOnBindFailure is true.-or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 581 of file Delegate.cs.

◆ CreateDelegate() [8/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
object  firstArgument,
MethodInfo  method 
)
static

Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument.

Parameters
typeThe T:System.Type of delegate to create.
firstArgumentThe object to which the delegate is bound, or null to treat method as static (Shared in Visual Basic).
methodThe T:System.Reflection.MethodInfo describing the static or instance method the delegate is to represent.
Returns
A delegate of the specified type that represents the specified static or instance method.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound.-or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 630 of file Delegate.cs.

◆ CreateDelegate() [9/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
object  firstArgument,
MethodInfo  method,
bool  throwOnBindFailure 
)
static

Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument and the specified behavior on failure to bind.

Parameters
typeA T:System.Type representing the type of delegate to create.
firstArgumentAn T:System.Object that is the first argument of the method the delegate represents. For instance methods, it must be compatible with the instance type.
methodThe T:System.Reflection.MethodInfo describing the static or instance method the delegate is to represent.
throwOnBindFailuretrue to throw an exception if method cannot be bound; otherwise, false.
Returns
A delegate of the specified type that represents the specified static or instance method, or null if throwOnBindFailure is false and the delegate cannot be bound to method .
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound, and throwOnBindFailure is true.-or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 654 of file Delegate.cs.

◆ CreateDelegate() [10/10]

static Delegate System.Delegate.CreateDelegate ( Type  type,
MethodInfo  method 
)
static

Creates a delegate of the specified type to represent the specified static method.

Parameters
typeThe T:System.Type of delegate to create.
methodThe T:System.Reflection.MethodInfo describing the static or instance method the delegate is to represent. Only static methods are supported in the .NET Framework version 1.0 and 1.1.
Returns
A delegate of the specified type to represent the specified static method.
Exceptions
T:System.ArgumentNullExceptiontype is null.-or- method is null.
T:System.ArgumentExceptiontype does not inherit T:System.MulticastDelegate.-or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method is not a static method, and the .NET Framework version is 1.0 or 1.1. -or- method cannot be bound.-or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection.
T:System.MissingMethodExceptionThe Invoke method of type is not found.
T:System.MethodAccessExceptionThe caller does not have the permissions necessary to access method .

Definition at line 795 of file Delegate.cs.

◆ DynamicInvoke()

object System.Delegate.DynamicInvoke ( params object []  args)

Dynamically invokes (late-bound) the method represented by the current delegate.

Parameters
argsAn array of objects that are the arguments to pass to the method represented by the current delegate.-or- null, if the method represented by the current delegate does not require arguments.
Returns
The object returned by the method represented by the delegate.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).-or- The number, order, or type of parameters listed in args is invalid.
T:System.ArgumentExceptionThe method represented by the delegate is invoked on an object or a class that does not support it.
T:System.Reflection.TargetInvocationExceptionThe method represented by the delegate is an instance method and the target object is null.-or- One of the encapsulated methods throws an exception.

Definition at line 122 of file Delegate.cs.

◆ DynamicInvokeImpl()

virtual object System.Delegate.DynamicInvokeImpl ( object []  args)
protectedvirtual

Dynamically invokes (late-bound) the method represented by the current delegate.

Parameters
argsAn array of objects that are the arguments to pass to the method represented by the current delegate.-or- null, if the method represented by the current delegate does not require arguments.
Returns
The object returned by the method represented by the delegate.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).-or- The number, order, or type of parameters listed in args is invalid.
T:System.ArgumentExceptionThe method represented by the delegate is invoked on an object or a class that does not support it.
T:System.Reflection.TargetInvocationExceptionThe method represented by the delegate is an instance method and the target object is null.-or- One of the encapsulated methods throws an exception.

Definition at line 135 of file Delegate.cs.

◆ Equals()

override bool System.Delegate.Equals ( object  obj)

Determines whether the specified object and the current delegate are of the same type and share the same targets, methods, and invocation list.

Parameters
objThe object to compare with the current delegate.
Returns
true if obj and the current delegate have the same targets, methods, and invocation list; otherwise, false.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).

Definition at line 148 of file Delegate.cs.

◆ GetHashCode()

override int System.Delegate.GetHashCode ( )

Returns a hash code for the delegate.

Returns
A hash code for the delegate.

Definition at line 191 of file Delegate.cs.

◆ GetInvocationList()

virtual Delegate [] System.Delegate.GetInvocationList ( )
virtual

Returns the invocation list of the delegate.

Returns
An array of delegates representing the invocation list of the current delegate.

Reimplemented in System.MulticastDelegate.

Definition at line 234 of file Delegate.cs.

◆ GetMethodImpl()

virtual MethodInfo System.Delegate.GetMethodImpl ( )
protectedvirtual

Gets the static method represented by the current delegate.

Returns
A T:System.Reflection.MethodInfo describing the static method represented by the current delegate.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).

Reimplemented in System.MulticastDelegate.

Definition at line 246 of file Delegate.cs.

◆ GetObjectData()

virtual void System.Delegate.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
virtual

Not supported.

Parameters
infoNot supported.
contextNot supported.
Exceptions
T:System.NotSupportedExceptionThis method is not supported.

Implements System.Runtime.Serialization.ISerializable.

Reimplemented in System.MulticastDelegate.

Definition at line 718 of file Delegate.cs.

◆ operator !=()

static bool System.Delegate.operator != ( Delegate  d1,
Delegate  d2 
)
static

Determines whether the specified delegates are not equal.

Parameters
d1The first delegate to compare.
d2The second delegate to compare.
Returns
true if d1 is not equal to d2 ; otherwise, false.

Definition at line 704 of file Delegate.cs.

◆ operator==()

static bool System.Delegate.operator== ( Delegate  d1,
Delegate  d2 
)
static

Determines whether the specified delegates are equal.

Parameters
d1The first delegate to compare.
d2The second delegate to compare.
Returns
true if d1 is equal to d2 ; otherwise, false.

Definition at line 693 of file Delegate.cs.

◆ Remove()

static Delegate System.Delegate.Remove ( Delegate  source,
Delegate  value 
)
static

Removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate.

Parameters
sourceThe delegate from which to remove the invocation list of value .
valueThe delegate that supplies the invocation list to remove from the invocation list of source .
Returns
A new delegate with an invocation list formed by taking the invocation list of source and removing the last occurrence of the invocation list of value , if the invocation list of value is found within the invocation list of source . Returns source if value is null or if the invocation list of value is not found within the invocation list of source . Returns a null reference if the invocation list of value is equal to the invocation list of source or if source is a null reference.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).
T:System.ArgumentExceptionThe delegate types do not match.

Definition at line 287 of file Delegate.cs.

◆ RemoveAll()

static Delegate System.Delegate.RemoveAll ( Delegate  source,
Delegate  value 
)
static

Removes all occurrences of the invocation list of a delegate from the invocation list of another delegate.

Parameters
sourceThe delegate from which to remove the invocation list of value .
valueThe delegate that supplies the invocation list to remove from the invocation list of source .
Returns
A new delegate with an invocation list formed by taking the invocation list of source and removing all occurrences of the invocation list of value , if the invocation list of value is found within the invocation list of source . Returns source if value is null or if the invocation list of value is not found within the invocation list of source . Returns a null reference if the invocation list of value is equal to the invocation list of source , if source contains only a series of invocation lists that are equal to the invocation list of value , or if source is a null reference.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).
T:System.ArgumentExceptionThe delegate types do not match.

Definition at line 311 of file Delegate.cs.

◆ RemoveImpl()

virtual Delegate System.Delegate.RemoveImpl ( Delegate  d)
protectedvirtual

Removes the invocation list of a delegate from the invocation list of another delegate.

Parameters
dThe delegate that supplies the invocation list to remove from the invocation list of the current delegate.
Returns
A new delegate with an invocation list formed by taking the invocation list of the current delegate and removing the invocation list of value , if the invocation list of value is found within the current delegate's invocation list. Returns the current delegate if value is null or if the invocation list of value is not found within the current delegate's invocation list. Returns null if the invocation list of value is equal to the current delegate's invocation list.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).

Reimplemented in System.MulticastDelegate.

Definition at line 336 of file Delegate.cs.

Property Documentation

◆ Method

MethodInfo System.Delegate.Method
get

Gets the method represented by the delegate.

Returns
A T:System.Reflection.MethodInfo describing the method represented by the delegate.
Exceptions
T:System.MemberAccessExceptionThe caller does not have access to the method represented by the delegate (for example, if the method is private).

Definition at line 34 of file Delegate.cs.

◆ Target

object System.Delegate.Target
get

Gets the class instance on which the current delegate invokes the instance method.

Returns
The object on which the current delegate invokes the instance method, if the delegate represents an instance method; null if the delegate represents a static method.

Definition at line 46 of file Delegate.cs.


The documentation for this class was generated from the following file: