ArcFM Desktop Developer Guide
CannotApplyEqualityOperatorAttribute Class
Members  Example 


Product Availability
Required Licenses
.NET Assembly
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.
Object Model
CannotApplyEqualityOperatorAttribute Class
Syntax
'Declaration
 
<AttributeUsageAttribute(ValidOn=AttributeTargets.Class Or  _
    AttributeTargets.Struct Or  _
    AttributeTargets.Interface, 
   AllowMultiple=False, 
   Inherited=True)>
Public NotInheritable Class CannotApplyEqualityOperatorAttribute 
   Inherits System.Attribute
'Usage
 
Dim instance As CannotApplyEqualityOperatorAttribute
[AttributeUsage(ValidOn=AttributeTargets.Class | 
    AttributeTargets.Struct | 
    AttributeTargets.Interface, 
   AllowMultiple=false, 
   Inherited=true)]
public sealed class CannotApplyEqualityOperatorAttribute : System.Attribute 
Example
[CannotApplyEqualityOperator]
class NoEquality { }
class UsesNoEquality {
  public void Test() {
    var ca1 = new NoEquality();
    var ca2 = new NoEquality();
    if (ca1 != null) { // OK
      bool condition = ca1 == ca2; // Warning
    }
  }
}
Inheritance Hierarchy

System.Object
   System.Attribute
      Miner.Desktop.DesignerExpress.Annotations.CannotApplyEqualityOperatorAttribute

Requirements

Target Platforms: Windows XP SP3 (32-bit and 64-bit), Windows 7 (32-bit and 64-bit)

Not all Operating Systems are supported on all products. Visit the ArcFM Solution Supported Versions page for full details.

See Also

Reference

CannotApplyEqualityOperatorAttribute Members
Miner.Desktop.DesignerExpress.Annotations Namespace

 

 


Send Comment