static void Main(string[] args)
        {
            var MultidimensionalDevice = new MultidimensionalDevice();

            MultidimensionalDevice.PowerOn(); Console.WriteLine(" Base");
            MultidimensionalDevice.TurnPrinterOn(); Console.WriteLine(" Printer");
            IDocument doc1 = new PDFDocument("aaa.pdf");

            MultidimensionalDevice.Print(in doc1);
            Console.WriteLine();

            MultidimensionalDevice.TurnScannerOn(); Console.WriteLine(" Scanner");
            IDocument doc2;

            MultidimensionalDevice.Scan(out doc2);
            MultidimensionalDevice.ScanAndPrint();
            Console.WriteLine();

            Console.WriteLine("PowerON Counter: " + MultidimensionalDevice.Counter);
            Console.WriteLine("Printer Counter: " + MultidimensionalDevice.PrintCounter);
            Console.WriteLine("Scanner Counter: " + MultidimensionalDevice.ScanCounter);
            Console.WriteLine();

            MultidimensionalDevice.PowerOn();
            Console.WriteLine(" Base");
            MultidimensionalDevice.TurnFaxOn();
            Console.WriteLine(" Fax");
            MultidimensionalDevice.TurnPrinterOn();
            Console.WriteLine(" Printer");
            MultidimensionalDevice.TurnScannerOn();
            Console.WriteLine(" Scanner");

            Console.WriteLine();
            IDocument doc3;

            MultidimensionalDevice.SendFax(out doc3, "test");
            IDocument doc4 = new ImageDocument("ImgDoc.jpg");

            MultidimensionalDevice.ReceiveFax(in doc4, "test");
            Console.WriteLine();

            Console.WriteLine("Fax Sent Counter: " + MultidimensionalDevice.SentFaxCounter);
            Console.WriteLine("Fax Recived Counter: " + MultidimensionalDevice.ReceivedFaxCounter);
            Console.WriteLine();

            MultidimensionalDevice.TurnFaxOff();
            Console.WriteLine(" Fax");
            MultidimensionalDevice.TurnPrinterOff();
            Console.WriteLine(" Printer");
            MultidimensionalDevice.TurnScannerOff();
            Console.WriteLine(" Scanner");
        }
        static void Main(string[] args)
        {
            Console.WriteLine("---Copier test---\n");
            Copier x = new Copier();

            Console.WriteLine($"copier counter: {x.Counter}");
            Console.WriteLine($"print counter: {x.PrintCounter}");
            Console.WriteLine(x.GetState());
            x.PowerOn();
            Console.WriteLine(x.GetState());
            Console.WriteLine("printing doc1.pdf");
            IDocument doc1 = new PDFDocument("doc1.pdf");

            x.Print(doc1);
            Console.WriteLine("scanning doc.txt");
            x.Scan(IDocument.FormatType.TXT);
            Console.WriteLine("scanning doc.jpg");
            x.Scan(IDocument.FormatType.JPG);

            Console.WriteLine($"copier counter: {x.Counter}");
            Console.WriteLine($"print counter: {x.PrintCounter}");
            Console.WriteLine($"scan counter: {x.ScanCounter}");

            Console.WriteLine("scanning and printing doc.pdf");
            x.ScanAndPrint(IDocument.FormatType.PDF);
            Console.WriteLine($"print counter: {x.PrintCounter}");
            Console.WriteLine($"scan counter: {x.ScanCounter}\n");
            Console.WriteLine("---MultidimensionalDevice test---\n");
            MultidimensionalDevice multi = new MultidimensionalDevice();

            Console.WriteLine(multi.GetState());
            multi.PowerOn();
            Console.WriteLine(multi.GetState());
            Console.WriteLine($"multi print counter: {multi.PrintCounter}");
            Console.WriteLine($"multi scan counter: {multi.ScanCounter}");
            multi.Print(doc1);
            Console.WriteLine("scanning doc.txt");
            multi.Scan(IDocument.FormatType.TXT);
            Console.WriteLine("scanning doc.jpg");
            multi.Scan(IDocument.FormatType.JPG);
            Console.WriteLine($"multi print counter: {multi.PrintCounter}");
            Console.WriteLine($"multi scan counter: {multi.ScanCounter}");
            Console.WriteLine("faxing .txt document to testRecievier");
            multi.FaxDocument("testReciever", IDocument.FormatType.TXT);
            Console.WriteLine("faxing .pdf document to testRecievier2");
            multi.FaxDocument("testReciever2", IDocument.FormatType.PDF);
            Console.WriteLine($"multi counter: {multi.Counter}");
            Console.WriteLine($"multi print counter: {multi.PrintCounter}");
            Console.WriteLine($"multi scan counter: {multi.ScanCounter}");
            Console.WriteLine($"multi fax counter: {multi.FaxCounter}");
        }
        static void Main(string[] args)
        {
            var xerox = new Copier();

            xerox.PowerOn();
            xerox.TurnPrinterOn();
            IDocument doc1 = new PDFDocument("aaa.pdf");

            xerox.Print(in doc1);

            xerox.TurnScannerOn();
            IDocument doc2;

            xerox.Scan(out doc2);

            xerox.ScanAndPrint();
            Console.WriteLine(xerox.Counter);
            Console.WriteLine(xerox.PrintCounter);
            Console.WriteLine(xerox.ScanCounter);

            Console.WriteLine();
            Console.WriteLine();

            var multiFuncDevice = new MultidimensionalDevice();

            multiFuncDevice.PowerOn();
            multiFuncDevice.TurnFaxOn();
            multiFuncDevice.TurnPrinterOn();
            multiFuncDevice.TurnScannerOn();

            IDocument doc3;

            multiFuncDevice.SendFax(out doc3, 0700800800);

            IDocument doc4 = new ImageDocument("ImgDoc.jpg");

            multiFuncDevice.ReceiveFax(in doc4, 0800700700);

            Console.WriteLine(multiFuncDevice.ReceivedFaxCounter);
            Console.WriteLine(multiFuncDevice.SentFaxCounter);
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            var xerox = new Copier();

            xerox.PowerOn();
            xerox.CopierPrinterOn();
            IDocument doc1 = new PDFDocument("aaa.pdf");

            xerox.Print(in doc1);

            xerox.CopierScannerOn();
            IDocument doc2;

            xerox.Scan(out doc2);
            xerox.Print(in doc2);

            xerox.ScanAndPrint();

            Console.WriteLine();
            xerox.PowerOff();

            Console.WriteLine();
            Console.WriteLine($"Counter: {xerox.Counter}");
            Console.WriteLine($"Print counter: {xerox.PrintCounter}");
            Console.WriteLine($"Scan counter: {xerox.ScanCounter}");

            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();

            var multiDevice = new MultidimensionalDevice();

            multiDevice.PowerOn();
            multiDevice.DevicePrinterOn();
            IDocument doc11 = new PDFDocument("123.pdf");

            multiDevice.Print(in doc11);

            multiDevice.DeviceScannerOn();
            IDocument doc22;

            multiDevice.Scan(out doc22);
            multiDevice.Print(in doc22);

            multiDevice.ScanAndPrint();

            multiDevice.DeviceFaxOn();

            multiDevice.ScanAndSend(123456789);
            multiDevice.ScanAndSend(987654321);

            Console.WriteLine();
            multiDevice.PowerOff();
            Console.WriteLine();
            multiDevice.PowerOn();
            Console.WriteLine();
            multiDevice.PowerOff();

            Console.WriteLine();
            Console.WriteLine($"Counter: {multiDevice.Counter}");
            Console.WriteLine($"Print counter: {multiDevice.PrintCounter}");
            Console.WriteLine($"Scan counter: {multiDevice.ScanCounter}");
            Console.WriteLine($"Fax counter: {multiDevice.FaxCounter}");
        }