MulticastDelegate.op_Equality Method

Determines whether the current multicast delegate and another specified delegate are equal.

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

Syntax

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

Parameters

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

Return Value

true if the d1 and d2 parameters contain the same invocation lists; 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

MulticastDelegate Class
MulticastDelegate Members
System Namespace