static void Main(string[] args) { Notebook notebook = new Notebook(); Note noteforremoval = null; for (int i = 0; i < 5; i++) { Note note = new Note("title" + i, "text" + i); notebook.AddNote(note); if (i == 3) { noteforremoval = note; } } notebook.RemoveNote(noteforremoval); var date = new DateTime(2020, 5, 20, 19, 21, 10); ToDoItem item = new ToDoItem("Anto", "zadatak3", date); CareTaker careTaker = new CareTaker(); careTaker.PushStack(item.StoreState()); item.Rename("Ivic"); item.ChangeTask("hehehe"); item.RestoreState(careTaker.PopStack()); }
//static void Zadatak3() //{ // CareTaker caretaker = new CareTaker(); // ToDoItem todoitem1 = new ToDoItem("Title1", "Text1", DateTime.Now); // caretaker.AddState(todoitem1.StoreState()); // ToDoItem todoitem2 = new ToDoItem("Title2", "Text2", DateTime.Now); // caretaker.AddState(todoitem2.StoreState()); // caretaker.ShowItems(); //} static void Zadatak4() { CareTaker caretaker = new CareTaker(); BankAccount bankaccount1 = new BankAccount("Mihael", "Koprivnica", 200); caretaker.AddState(bankaccount1.StoreState()); BankAccount bankaccount2 = new BankAccount("Opet Mihael", "Koprivnica", 400); caretaker.AddState(bankaccount2.StoreState()); caretaker.ShowItems(); }