public override void HandleRequest(int flag, ObservableCollection <MyTask> Tasks, MyTask selectedTask) { if (flag == 4) { MyTask t = new MyTask(); t.Title = "New task"; Tasks.Add(t); List <MyTask> l = new List <MyTask>(); foreach (MyTask m in Tasks) { l.Add(m); } l.Reverse(); Tasks.Clear(); for (int i = 0; i < l.Count; i++) { Tasks.Add(l[i]); } XmlSerialDeSerial x = new XmlSerialDeSerial(); x.SerializeObject(Tasks, "DbTasks"); MessageBox.Show("Added"); return; } else if (Successor != null) { Successor.HandleRequest(flag, Tasks, selectedTask); } }
public override void HandleRequest(int flag, ObservableCollection <MyTask> Tasks, MyTask selectedTask) { if (flag == 3 && selectedTask != null) { XmlSerialDeSerial x = new XmlSerialDeSerial(); x.SerializeObject(Tasks, "DbTasks"); MessageBox.Show("Saved"); return; } else if (Successor != null) { Successor.HandleRequest(flag, Tasks, selectedTask); } }