static void CreatorExample_1() { object[] args = new object[2]; string canvas = "default"; System.Console.Write("Enter canvas name: "); canvas = System.Console.ReadLine(); args[0] = canvas; //THE ARGUMENT IS PASSED HERE int window = 0; System.Console.Write("Enter window id: "); String id = System.Console.ReadLine(); if (!Int32.TryParse(id, out window)) { System.Console.WriteLine("Using id 0"); } args[1] = window; //THE ARGUMENT IS PASSED HERE Creator <IButton> button = new UniversalCreator <IButton, WinButton>(args); Creator <ICheckBox> checkBox = new UniversalCreator <ICheckBox, WebCheckBox>(null); CreatorFactory factory = new CreatorFactory(button, checkBox); System.Console.WriteLine(factory.CreateButton()); System.Console.WriteLine(factory.CreateCheckBox()); }
static void CreatorExample_0() { System.Console.Write("Enter canvas name: "); String canvas = System.Console.ReadLine(); Creator <IButton> button = new CreatorUnixButton(canvas, 0, 0.0f, 0.0f); Creator <ICheckBox> checkBox = new CreatorUnixCheckBox(canvas, 0, 0.0f, 0.0f); CreatorFactory factory = new CreatorFactory(button, checkBox); System.Console.WriteLine(factory.CreateButton()); System.Console.WriteLine(factory.CreateCheckBox()); }