Код: Выделить всё
namespace Test
{
static class Program
{
bool keyA = false;
bool keyB = false;
// ...
static void Main(string[] args)
{
foreach (string arg in args)
{
switch (arg.ToLowerInvariant())
{
case "-a":
if(keyA) break;
keyA = true;
// do here also what the A key requires
break;
case "-b":
if(keyB) break;
keyB = true;
// do here also what the B key requires
goto case "-a"; // key B includes the action of key A
// ...
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... thout-goto