//------------------------------------------------------------------------------------ /// <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)); }
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; } }
//------------------------------------------------------------------------------------ /// <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); }
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); } } } } }
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); } } }
void Planner_InvalidHierarchicalItemDetected(object sender, InvalidHierarchicalItemEvent e) { m_invalidHierarchicalItems.Add(e.InvalidItem); }