static void Main(string[] args) { string description = Console.ReadLine().ToLower(); IMachine machine = new MachineFactory().CreateInstance(description); machine.Identify(); machine.Operate(); Console.ReadKey(); }
static void Main(string[] args) { string description = args[0]; IMachine machine = new MachineFactory().CreateInstance(description); machine.TurnOn(); machine.TurnOff(); Console.ReadKey(); }
static void Main(string[] args) { /* Assembly assemblyx = Assembly.Load("FactorypatternLib"); * foreach (var assemblyName in Assembly.GetExecutingAssembly() * .GetReferencedAssemblies()) * { * Assembly assembly = Assembly.Load(assemblyName); * foreach (var type in assembly.GetTypes()) * { * Console.WriteLine(type.Name); * } * }*/ //Assembly.GetAssembly() MachineFactory mf = new MachineFactory(); var r = mf.CreateInstance("rob"); r.TurnOn(); //Type[] types = Assembly.GetAssembly( typeof(FactorypatternLib.)).GetTypes(); Console.WriteLine(); }