Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Underscore valid syntax C# 1614, 2005

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
Andre Posted - Oct 26 2007 : 10:22:49 AM
In the following code the last Controls is underscored

foreach (ProcessView processView in ((Control)sender).Controls)

The explicit cast is ignored

Andre
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Oct 27 2007 : 09:14:36 AM
I have been trying to get a test case that compiles, but I got there finally. If it does not compile I don't trust the test

case=9572
Andre Posted - Oct 26 2007 : 3:21:50 PM
Here is a complete method that you should be able to create easily
the word Controls is underline

internal static void xxx(Control parent)
        {
            foreach (ProcessView processView in ((Control)parent).Controls)
                ;
        }


but

internal static void xxx(Control parent)
        {
            foreach (ProcessView processView in parent.Controls)
                ;
        }


works perfectly

This should help

Andre
feline Posted - Oct 26 2007 : 1:50:39 PM
I am not getting very far with the first example. I have the following test piece of code, which compiles quite happily:

        void testCastOnControlVariables()
        {
            Button buttonTest = new Button();
            String nameOfButton;
            nameOfButton = ((Control)buttonTest).Name;
        }


but there is no underlining. If you try calling some other function after the cast does the underlining go away? I am wondering if somehow this is related to the second example, and variable names are a problem.


I am seeing the same problem with the second example, and the problem seems to be the variable name "remove". I have simplified it down, and produced this test case:

        void testAddOnList()
        {
            List<string> remove = new List<string>();
            remove.Add("Chocolate cookies");    // here "Add" is underlined as a mistyped symbol
            List<string> foodNames = new List<string>();
            foodNames.Add("Chocolate bars");    // no underlining here
        }


"remove" is shown in italic's when I first type it, before VA realises I am using it as a local variable, so this seems to be a factor.

case=9568
Andre Posted - Oct 26 2007 : 12:44:24 PM
Hi,

This is another problem the Add is unexpectedly underscored


            List<Connector> remove = new List<Connector>();
            Connector c = new Connector();
            remove.Add(c);

Maybe easier to test
Thanks for all your work this is a fantastic product.

Andre

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