Share via


Delegate.op_Equality Method

Determines whether the specified delegates are equal to one another.

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

Syntax

[MethodImplAttribute]
public static bool op_Equality (
         Delegate d1,
         Delegate d2
)

Parameters

  • d1
    The first delegate you want to compare.
  • d2
    The second delegate you want to compare.

Return Value

true if d1 is equal to d2; otherwise, false.

Remarks

Two delegates with the same methods, the same targets, and the same invocation lists are considered equal, even if they are not both multicast (combinable) or both singlecast (uncombinable).

The methods and targets are compared for equality as follows:

  • If the two methods being compared are both static and are the same method used on the same class, the methods are considered equal and the targets are also considered equal.
  • If the two methods being compared are instance methods and are the same method used on the same object, the methods are considered equal and the targets are also considered equal.
  • Otherwise, the methods are not considered equal and the targets are also not considered equal.

Two invocation lists are considered identical if they have the same order and the corresponding elements from the two lists represent the same method and target.

Version Information

Available in the .NET Micro Framework versions 2.0, 2.5, 3.0, 4.0, 4.1, and 4.2.

See Also

Reference

Delegate Class
Delegate Members
System Namespace