Author |
Topic |
|
mspa
Senior Member
Netherlands
44 Posts |
Posted - Aug 21 2006 : 07:41:39 AM
|
MSVC 2003, C#, VAX 1532.
When I want to rename an enumeration value using refactoring, I expect that also each reference I use of this value is renamed. However those are not found and not renamed.
However a lot of other incorrect references are found. When I have an enumeration value 'Console' and want to rename it, each call to Console.WriteLine() is also found. |
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Aug 21 2006 : 7:19:11 PM
|
i am seeing the same thing here
case=2188
i can understand why the parser is getting confused with this. did you inherit this code from someone else? it seems like a rather confusing name to have selected, even allowing for how you reference enum's in C# |
zen is the art of being at one with the two'ness |
|
|
mspa
Senior Member
Netherlands
44 Posts |
Posted - Aug 22 2006 : 03:17:32 AM
|
That's the reason I wanted to rename the enumeration value using refactoring
Actually I agree that the name of the enumeration value is not the best but on the other hand what is so against naming enumeration values the same as existing classes that have nothing to do with it.
To clearify, the enumeration is used to specify how output is shown to the user:
enum DisplayOption
{
Console,
Dialog,
Both
} |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Aug 26 2006 : 1:35:58 PM
|
speaking as a full time C++ programmer, "how can i tell what i am doing"?
over time the way C# handles its enum's is definitely growing on me, especially since i keep on getting name conflicts with my enum values. *considers* actually inspired by this i probably need to wrap each of my problem enum's in their own individual namespaces.
from a purely practical, helping VA to work point of view the problem is that the code that does the enhanced syntax colouring is quite limited, it has to be in order to run fast enough to do real time colouring. as a result duplicate names tend to confuse it, leading to strange and confusing colouring.
which is at odds with your very sensible enum names. sometimes the best answer is not all that obvious |
zen is the art of being at one with the two'ness |
|
|
jpizzi
Tomato Guru
USA
642 Posts |
Posted - Aug 29 2006 : 01:20:12 AM
|
An alternative to "individual namespaces" is a class/struct (yea, it is essentially the same). |
Joe Pizzi |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 02 2006 : 12:25:24 PM
|
i tried the namespace, but it seems you cannot create a new namespace inside a class. it makes sense, but was not helpful.
the class in question has 9 enum's in it already, some of which want to have overlapping names. i may try wrapping them in stuctures / classes next time i have to edit them, at least i know that will compile |
zen is the art of being at one with the two'ness |
|
|
support
Whole Tomato Software
5566 Posts |
Posted - Jul 07 2007 : 12:38:30 AM
|
case=2188 is fixed in Build 1559 |
|
|
|
Topic |
|