Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Syntax highlight enumaration > classmembers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mspa
Senior Member

Netherlands
44 Posts

Posted - Jul 24 2006 :  05:18:51 AM  Show Profile  Reply with Quote
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
   }
}


feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 24 2006 :  7:09:08 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

mspa
Senior Member

Netherlands
44 Posts

Posted - Jul 25 2006 :  03:29:27 AM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 25 2006 :  7:40:47 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000