Example #1
0
 /// <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);
     }
 }
Example #2
0
        public Epic GetHighestRatedEpic()
        {
            Epic epic;

            try
            {
                epic = Epics.Where(e => e.GetAverageRating() == Epics.Max(e => e.GetAverageRating())).FirstOrDefault();
            }
            catch (InvalidOperationException)
            {
                return(null);
            }

            return(epic);
        }
Example #3
0
        public Epic GetEpicByTitle(string name)
        {
            Epic epic;

            try
            {
                epic = Epics.FirstOrDefault(e => e.Title == name);
            }
            catch (InvalidOperationException)
            {
                return(null);
            }

            return(epic);
        }
Example #4
0
        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);
            });
        }
Example #6
0
 /// <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;
 }