예제 #1
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Accepts a new item that has never been saved to the store, and prepares it
        /// to be saved on the next Commit operation.
        /// </summary>
        //------------------------------------------------------------------------------------
        public void NewItemAccepted(StoreItem item)
        {
            System.Diagnostics.Debug.Assert(item.IsNew);
            item.PersistState = PersistStates.NewCommitted;
            AddToCache(item);

            m_changedItems.Add(item);
            Planner.OnChangeListUpdated(this, new ChangeListUpdatedEventArgs(m_changedItems.Count));
        }
예제 #2
0
        void AddToItemTypeCache(StoreItem item)
        {
            switch (item.StoreItemType)
            {
            case ItemTypeID.Train:
                TrainItem trainItem = (TrainItem)item;
                if (trainItem.EndDate.AddDays(45) >= DateTime.Today)
                {
                    TrainItems.Add((TrainItem)item);
                }
                break;

            case ItemTypeID.ProductGroup:
                ProductGroupItems.Add((ProductGroupItem)item);
                break;

            case ItemTypeID.Persona:
                PersonaItems.Add((PersonaItem)item);
                break;

            case ItemTypeID.PlannerBug:
                PlannerBugItems.Add((PlannerBugItem)item);
                break;

            case ItemTypeID.GroupMember:
                GroupMemberItems.Add((GroupMemberItem)item);
                break;
            }
        }
예제 #3
0
        //------------------------------------------------------------------------------------
        /// <summary>
        /// Given a list of objects, return a store item collection of the specified type of
        /// StoreItems.  If none of the objects in the given list are of that type, an empty
        /// list will be returned.
        /// </summary>
        //------------------------------------------------------------------------------------
        public static StoreItemCollection <T> GetStoreItemsFromList <T>(IList items) where T : StoreItem, new()
        {
            StoreItemCollection <T> storeItems = new StoreItemCollection <T>();

            foreach (object item in items)
            {
                T storeItem = item as T;
                if (storeItem != null)
                {
                    storeItems.Add(storeItem);
                }
            }

            return(storeItems);
        }
예제 #4
0
        private void BuildBacklogItems()
        {
            m_backlogItems       = new StoreItemCollection <BacklogItem>();
            m_activeBacklogItems = new StoreItemCollection <BacklogItem>();
            foreach (WorkItem workItem in m_workItems)
            {
                BacklogItem backlogItem = workItem.ParentBacklogItem;
                if (backlogItem != null)
                {
                    if (!m_backlogItems.Contains(backlogItem))
                    {
                        m_backlogItems.Add(backlogItem);

                        if (backlogItem.IsActive)
                        {
                            m_activeBacklogItems.Add(backlogItem);
                        }
                    }
                }
            }
        }
예제 #5
0
        private void BuildWorkItemCollections()
        {
            m_notStartedWorkItems = new StoreItemCollection <WorkItem>();
            m_inProgressWorkItems = new StoreItemCollection <WorkItem>();
            m_completedWorkItems  = new StoreItemCollection <WorkItem>();

            foreach (WorkItem workItem in WorkItems)
            {
                if (workItem.ItemStatus == WorkItemStates.NotStarted)
                {
                    m_notStartedWorkItems.Add(workItem);
                }
                else if (workItem.ItemStatus == WorkItemStates.InProgress)
                {
                    m_inProgressWorkItems.Add(workItem);
                }
                else if (workItem.ItemStatus == WorkItemStates.Completed)
                {
                    m_completedWorkItems.Add(workItem);
                }
            }
        }
예제 #6
0
 void Planner_InvalidHierarchicalItemDetected(object sender, InvalidHierarchicalItemEvent e)
 {
     m_invalidHierarchicalItems.Add(e.InvalidItem);
 }