/// <summary> /// Entfernt ein Item aus der Datenbank /// </summary> /// <param name="item"></param> public void RemoveItem(ItemBase item) { foreach (ItemControl ic in item.Representations) { ic.RemoveFromSurface(); } if (item.GetType() == typeof(UserStory)) { UserStories.Remove(item as UserStory); } if (item.GetType() == typeof(Epic)) { Epics.Remove(item as Epic); } }
public Epic GetHighestRatedEpic() { Epic epic; try { epic = Epics.Where(e => e.GetAverageRating() == Epics.Max(e => e.GetAverageRating())).FirstOrDefault(); } catch (InvalidOperationException) { return(null); } return(epic); }
public Epic GetEpicByTitle(string name) { Epic epic; try { epic = Epics.FirstOrDefault(e => e.Title == name); } catch (InvalidOperationException) { return(null); } return(epic); }
public Epic GetEpicById(int id) { Epic epic; try { epic = Epics.FirstOrDefault(e => e.ID == id); } catch (InvalidOperationException) { return(null); } return(epic); }
public void Start() { if (active) { throw new Exception("already started"); } active = true; var actions = Observable.Merge(Epics.Select(epic => epic.Configure(ActionObservable.Actions))); Subscription = actions.ObserveOn(SchedulerProvider.Scheduler).Subscribe((action) => { ActionDispatcher.Dispatch(action); }); }
/// <summary> /// Fügt ein neues Item zu der Datenbank hinzu /// </summary> /// <param name="item"></param> public void AddItem(ItemBase item) { if (item.GetType() == typeof(UserStory)) { UserStory us = item as UserStory; UserStories.Add(us); us.ProjectStatusChanged += us_ProjectStatusChanged; us.Effort.EffortPointsChanged += (s, e) => { RecalcEffortSum(); }; if (us.temp_epicID > 0) { us.Epic = GetItem(us.temp_epicID) as Epic; } if (us.BacklogStatus == ItemBacklogStatus.SPRINT_BACKLOG) { this.EffortSum += us.Effort; } } else { Epics.Add(item as Epic); } Surface.ViewController.CurrentView.LoadItem(item); item.DataChanged += OnItemChanged; }