switch (command.ID) {
case CommandID.Text:
Int32 index;
if (!Int32.TryParse(command.Parameters[0], out index)) return false;
if (index < 1 || index > 3) return false;
// TODO
return true;
case CommandID.Led:
Int32 index;
if (!Int32.TryParse(command.Parameters[0], out index)) return false;
if (!Enum.IsDefined(typeof(Leds), index)) return false;
bool state;
if (!Boolean.TryParse(command.Parameters[1], out state)) return false;
// TODO
return true;
}
This gives the error:
A local variable named 'index' is already defined in this scope
for the second "Int32 index;" line. But that is in another case...?