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
 Feature Requests
 Ability to autogenerate switch cases
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sirusdv
New Member

3 Posts

Posted - May 18 2011 :  04:08:52 AM  Show Profile  Reply with Quote
I've been using VAX for almost 6 years at this point and I recently developed a need for this.

For instance in C# if I have an enum as such:

enum Colors
{
   Red,
   Green,
   Blue
}


and a function that I'm starting to write

void DoStuff(Color c) { ... }


And I start writing the following:


switch(c)
{



I'd like there to be a way to auto populate all the cases as such:


switch(c)
{
   case Color.Red:
   case Color.Green:
   case Color.Blue:
   default:
}


Maybe have an option for adding a break or a throw in the auto generated cases.


Thanks!


Edited by - Sirusdv on May 18 2011 04:10:09 AM

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - May 18 2011 :  1:01:39 PM  Show Profile  Reply with Quote
This is something we are looking into adding to VA Snippets:

case=19137

Since you are working in C#, depending on the IDE you are using, the built in IDE snippets may already allow you to do this. This page shows an example of the effect:

http://worthyd.com/techblog/index.php/2010/09/visual-studio-c-enum-switch-snippet-blew-my-mind/

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Aug 21 2015 :  12:27:04 AM  Show Profile  Reply with Quote
case=19137 is implemented in build 2073 as the command "Add Missing Case Statements"
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