RingSoft.DataEntryControls.Engine.Annotations Namespace
RingSoft.DataEntryControls.WPF Namespace

CannotApplyEqualityOperatorAttribute Class

Indicates that the value of the marked type (or its derivatives) cannot be compared using '==' or '!=' operators and Equals() should be used instead. However, using '==' or '!=' for comparison with null is always permitted.

Namespace:  RingSoft.DataEntryControls.Engine.Annotations
Assembly:  RingSoft.DataEntryControls.Engine (in RingSoft.DataEntryControls.Engine.dll)

Syntax


[AttributeUsageAttribute]
public sealed class CannotApplyEqualityOperatorAttribute : Attribute
<AttributeUsageAttribute> _
Public NotInheritable Class CannotApplyEqualityOperatorAttribute _
	Inherits Attribute
[AttributeUsageAttribute]
public ref class CannotApplyEqualityOperatorAttribute sealed : public Attribute

Examples


C#
[CannotApplyEqualityOperator]
class NoEquality { }
class UsesNoEquality {
void Test() {
var ca1 = new NoEquality();
var ca2 = new NoEquality();
if (ca1 != null) { // OK
bool condition = ca1 == ca2; // Warning
}
}
}

Inheritance Hierarchy


Object
  Attribute
    RingSoft.DataEntryControls.Engine.Annotations..::..CannotApplyEqualityOperatorAttribute