static void Main(string[] args) { PrinterCreater printerCreater = null; printerCreater = new Canon("Canon"); printerCreater.PrintMethod(); printerCreater = new HP("HP"); printerCreater.PrintMethod(); Console.ReadKey(); }
static void Run(String Pat, String Source) { List <int> result = new List <int>(); Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); result = HP.FindAll(Pat, Source); stopwatch.Stop(); Console.WriteLine(stopwatch.Elapsed); }
static void Main(string[] args) { Printer printer = new Canon("принтер Canon"); Paper paper1 = printer.Create(); printer.Print(paper1.Type); printer = new HP("принтер HP"); Paper paper2 = printer.Create(); printer.Print(paper2.Type); Console.ReadLine(); }
public static HP Compile(String pattern) { char[] x = pattern.ToCharArray(); int m = x.Length; int[] bmBc = new int[65536]; PreBmBc(x, bmBc); HP hp = new HP(); hp.x = x; hp.bmBc = bmBc; hp.m = m; return(hp); }