Exemple #1
0
        static void Main(string[] args)
        {
            Printer p = new Printer();
            DelegatePrinter dS = new DelegatePrinter(StartPrinter);
            DelegatePrintPage dPages = new DelegatePrintPage(PrintPage);
            DelegatePrinter dE = new DelegatePrinter(PrintExit);

            Console.Write("Number of pages: ");
            int c = int.Parse(Console.ReadLine());
            Console.WriteLine();

            p.Click += dS;
            p.OnStart();
            p.PrPage += dPages;
            p.PrintYourPage(c);
            p.ExPrint += dE;
            p.ExitPrint();
            Console.Read();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Printer           p      = new Printer();
            DelegatePrinter   dS     = new DelegatePrinter(StartPrinter);
            DelegatePrintPage dPages = new DelegatePrintPage(PrintPage);
            DelegatePrinter   dE     = new DelegatePrinter(PrintExit);

            Console.Write("Number of pages: ");
            int c = int.Parse(Console.ReadLine());

            Console.WriteLine();

            p.Click += dS;
            p.OnStart();
            p.PrPage += dPages;
            p.PrintYourPage(c);
            p.ExPrint += dE;
            p.ExitPrint();
            Console.Read();
        }