Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Syntax highlight enumaration > classmembers

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
mspa Posted - Jul 24 2006 : 05:18:51 AM
In a normal situation syntax highlight makes a property/member of a class light gray and an enumeration value light purple. But in the situation where both have the same name, the property/member of a class will be highlighted as an enumeration value.

class MyClass
{
   enum MyEnum { member1, member2 }

   public void Function()
   {
      SomeClass instance = new SomeClass();
      instance.member1;       // <--- The word member1 is colored as an enumeration
      instance.anotherMember; // <--- Normal colored as member
   }
}


3   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 25 2006 : 7:40:47 PM
to be honest i would prefer to pretend i had not seen this i suspect this will be rather difficult to fully fix, for limited benefit.
mspa Posted - Jul 25 2006 : 03:29:27 AM
No I don't get it a lot, just happened yesterday when I had to solve some code style issues. Instead of using index numbers to retrieve data from a DataTable we now use an Enumeration which sums up the fields. Because these fields are mapped on a class with members it seemed logical to keep the names the same.

Normally I dont think naming class members and enumeration values the same is good code practise but it is in this case.

So to give a you short answer:

No I don't have code like this regulary
feline Posted - Jul 24 2006 : 7:09:08 PM
do you regularly run into code like this? the syntax highlighting code can be easily confused by "strange" things, since it has to run very fast, to keep up with scrolling, so it cannot be to complex or clever.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000