c# switch when pattern matching