Pattern Matching in c#