Пример #1
0
        public static DarkThemeGraphicalElementsFactory GetInstance()
        {
            if (_instance == null)
            {
                _instance = new DarkThemeGraphicalElementsFactory();
            }

            return(_instance);
        }
Пример #2
0
        public void Main()
        {
            Console.WriteLine("Client: Testing client code with the first factory type...");
            ClientMethod(LightThemeGraphicalElementsFactory.GetInstance());
            Console.WriteLine();

            Console.WriteLine("Client: Testing the same client code with the second factory type...");
            ClientMethod(DarkThemeGraphicalElementsFactory.GetInstance());
        }