Skip to content

Instantly share code, notes, and snippets.

@Andrea
Created July 1, 2011 13:28
Show Gist options
  • Save Andrea/1058541 to your computer and use it in GitHub Desktop.
Save Andrea/1058541 to your computer and use it in GitHub Desktop.
public void MyMethod()
{
switch ( something )
{
// other stuff ...
case x:
{
// do some stuff here
// need to perform case y too for this specific case
DoSomethingImportant();
//break; // not allowed to not have the break
}
case y:
{
DoSomethingImportant();
// do some more stuff here
break;
}
}
}
public void DoSomethingImportant()
{
//Some logic that needs to be reused
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment