Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Ability to autogenerate switch cases

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
Sirusdv Posted - May 18 2011 : 04:08:52 AM
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!

2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Aug 21 2015 : 12:27:04 AM
case=19137 is implemented in build 2073 as the command "Add Missing Case Statements"
feline Posted - May 18 2011 : 1:01:39 PM
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/

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