C# implementation of Design Pattern