I have a switch case in a section of my function, and I need to reorder some cases to read the code better.
So, the code at the moment looks something like this:
switch(parameter) { case "foo" : {DoSomething; DoSomething; DoSomething; DoSomething; break } case "bar" : {DoSomething; DoSomething; DoSomething; DoSomething; break } .... case "alpha" : {DoSomething; DoSomething; DoSomething; DoSomething; break } case "beta" : {DoSomething; DoSomething; DoSomething; DoSomething; break } }
So, I have hundreads of cases inside this switch statement, and I need to reorder most of them. And although reordering, for example, if I want to put case foo and case bar below cases alpha and beta. Simple Ctrl+c and Ctrl+v give me this output:
switch(parameter) { case "alpha" : {DoSomething; DoSomething; DoSomething; DoSomething; break } case "beta" : {DoSomething; DoSomething; DoSomething; DoSomething; break } ...... case "foo" : {DoSomething; DoSomething; DoSomething; DoSomething; break } case "bar" : {DoSomething; DoSomething; DoSomething; DoSomething; break } }
Reordering this text several times is a cumbersome task. Is there a way that can duplicate a string as it is in some other part of the code?
For example, I want all the text to remain on one line, as before,
case "foo" : {DoSomething; DoSomething; DoSomething; DoSomething; break } case "bar" : {DoSomething; DoSomething; DoSomething; DoSomething; break }
c # visual-studio
agenthost
source share