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
 Underscore valid syntax C# 1614, 2005
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Andre
Junior Member

Canada
20 Posts

Posted - Oct 26 2007 :  10:22:49 AM  Show Profile  Reply with Quote
In the following code the last Controls is underscored

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

The explicit cast is ignored

Andre

Edited by - Andre on Oct 26 2007 10:23:18 AM

Andre
Junior Member

Canada
20 Posts

Posted - Oct 26 2007 :  12:44:24 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Oct 26 2007 :  1:50:39 PM  Show Profile  Reply with Quote
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

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

Andre
Junior Member

Canada
20 Posts

Posted - Oct 26 2007 :  3:21:50 PM  Show Profile  Reply with Quote
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
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Oct 27 2007 :  09:14:36 AM  Show Profile  Reply with Quote
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

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