Пример #1
0
        public static void CopyMachineExample()
        {
            var copyMachine = new CopyMachine(5);

            copyMachine.InsertMoney(20);
            copyMachine.ChooseDevice(Device.FlashCard);
            copyMachine.ChooseDocument("very important document", 3);
            copyMachine.PrintDocument();
            copyMachine.PrintMoreDocuments(false);
            var change = copyMachine.GetChange();
        }
Пример #2
0
        private static void StateHomework()
        {
            var machine = new CopyMachine();

            machine.PutMoney(6);
            machine.SetDevice(new UsbFlashDrive());
            machine.ChooseDocument(new WordDocument());
            machine.PrintDocument();
            machine.ChooseDocument(new PdfDocument());
            machine.PrintDocument();
            var c = machine.GetBackChange();

            Console.WriteLine(c);
        }
Пример #3
0
        private static void MyExample()
        {
            var copyMachine = new CopyMachine();

            copyMachine.CurrentMessage();
            copyMachine.EnterValue("20");
            copyMachine.CurrentMessage();
            copyMachine.EnterValue("usb");
            copyMachine.CurrentMessage();
            copyMachine.EnterValue("text.txt");
            copyMachine.CurrentMessage();
            copyMachine.EnterValue("да");
            copyMachine.CurrentMessage();
            copyMachine.EnterValue("nextText.txt");
            copyMachine.CurrentMessage();
            copyMachine.EnterValue("нет");
        }
Пример #4
0
 public StateBase(CopyMachine context)
 {
     Context = context;
 }
Пример #5
0
 public FinishState(CopyMachine context) : base(context)
 {
 }
Пример #6
0
 public GetChangeState(CopyMachine context) : base(context)
 {
 }
Пример #7
0
 public PrintMoreDocumentsState(CopyMachine context) : base(context)
 {
 }
Пример #8
0
 public PrintDocumentState(CopyMachine context) : base(context)
 {
 }
Пример #9
0
 public InsertMoreMoneyState(CopyMachine context) : base(context)
 {
 }
Пример #10
0
 public ChooseDocumentState(CopyMachine context) : base(context)
 {
 }
Пример #11
0
 public ChooseDeviceState(CopyMachine context) : base(context)
 {
 }
Пример #12
0
 public InitState(CopyMachine context) : base(context)
 {
 }