New Posts New Posts RSS Feed: Operator '=' is not defined for DevForce enumeration classes
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Operator '=' is not defined for DevForce enumeration classes

 Post Reply Post Reply
Author
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Topic: Operator '=' is not defined for DevForce enumeration classes
    Posted: 12-Jul-2007 at 1:34pm

I believe the default behavior of == [C#] and = [VB], for reference types,  is determine whether the objects being compared represent the same instance.  Equals, on the other hand, looks to determine equality by a prescribed comparison of the two objects (e.g., if it looks like a duck and quacks like a duck, it's a duck).  So I'm not surprised that Equals is the one that's working for enum entities, rather than "=".  Whether the docs are just wrong or there's been some change in the enumeration entities behavior (the behavior of the comparison operators for a given class can be overridden in that class), I'm not entirely sure, but my guess would be that the docs are just wrong, and always were.

Thanks for the heads up - and stick with Equals! 

Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 1:32pm
Operator '=' is not defined for DevForce enumeration classes.

Although it seems to be exampled with it in the Developer’s guide…

I’m having to use the Equals method… Is using Equals the best technique?

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down