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(); }
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); }
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("нет"); }
public StateBase(CopyMachine context) { Context = context; }
public FinishState(CopyMachine context) : base(context) { }
public GetChangeState(CopyMachine context) : base(context) { }
public PrintMoreDocumentsState(CopyMachine context) : base(context) { }
public PrintDocumentState(CopyMachine context) : base(context) { }
public InsertMoreMoneyState(CopyMachine context) : base(context) { }
public ChooseDocumentState(CopyMachine context) : base(context) { }
public ChooseDeviceState(CopyMachine context) : base(context) { }
public InitState(CopyMachine context) : base(context) { }