/// <summary> /// Tilføjer en story til et sprint. Når man tilføjer en story til et sprint vil den blive fjernet fra backloggen. /// </summary> /// <param name="name">String name er navnet på det listviewet den skal flyttes hen til </param> public void MoveStory(string name) { switch (name) { case "Backlog": Backlog.Add(DragStory); SprintBacklog.Remove(DragStory); break; case "SprintBacklog": SprintBacklog.Add(DragStory); Backlog.Remove(DragStory); break; } }
/// <summary> /// The edit execute command. This will be called from mainwindow code behind, since it is a double click method. /// </summary> /// <param name="name">A string that define which Listbox the method was called from</param> public void ViewDetails(string name) { var dlg = new EditView(); BackLog toEdit = new BackLog(); //Each switch case will open a window see above, and will set the datacontext of the view to the current selected object in the specified listbox //When this window is succesfully completed, it will sync the possible new data with the database, and remove it from the possible old list. //After this it wil add it to the possible new list (if we have changed status or not). switch (name) { case "Backlog": toEdit = Backlog[BackLogCurrentIndex]; dlg.DataContext = toEdit; if (dlg.ShowDialog() == true) { PutTask(toEdit); Backlog.Remove(toEdit); RefreshMainWindow(toEdit); } break; case "IsToDo": toEdit = ToDo[ToDoCurrentIndex]; dlg.DataContext = toEdit; if (dlg.ShowDialog() == true) { PutTask(toEdit); ToDo.Remove(toEdit); RefreshMainWindow(toEdit); } break; case "Doing": toEdit = Doing[DoingCurrentIndex]; dlg.DataContext = toEdit; if (dlg.ShowDialog() == true) { PutTask(toEdit); Doing.Remove(toEdit); RefreshMainWindow(toEdit); } break; case "Done": toEdit = Done[DoneCurrentIndex]; dlg.DataContext = toEdit; if (dlg.ShowDialog() == true) { PutTask(toEdit); Done.Remove(toEdit); RefreshMainWindow(toEdit); } break; default: break; } UpdateChart(); }