private void ExecuteBuilder(IPatternExecutor pattern) { if (pattern != null) { Console.WriteLine(pattern.Description()); Console.WriteLine(); Console.WriteLine(pattern.DescriptionPL()); pattern.Execute(); Console.WriteLine(); } }
//Factory for specific executer protected virtual IPatternExecutor PatternExecutorFactory(int index, string assembly) { IPatternExecutor _pattern = null; if (IdsAndNamesOfClasses.Count >= index) { Type type = Type.GetType(string.Format("{0}.{1}", assembly, IdsAndNamesOfClasses[index])); object t = Activator.CreateInstance(type); if (t != null) { _pattern = (IPatternExecutor)t; } } return(_pattern); }