Beispiel #1
0
        public static AsyncObservableCollection <T> GetItems <T>(this AsyncObservableCollection <T> collection, DummyItemType collectionType) where T : StoreItem, new()
        {
            AsyncObservableCollection <T> items = collection.ToCollection();

            items.Sort((x, y) => x.Title.CompareTo(y.Title));

            if (collectionType == DummyItemType.NoneType || collectionType == DummyItemType.AllNoneType)
            {
                T item = StoreItem.GetDummyItem <T>(DummyItemType.NoneType);
                items.Insert(0, item);
            }

            if (collectionType == DummyItemType.AllType || collectionType == DummyItemType.AllNoneType)
            {
                T item = StoreItem.GetDummyItem <T>(DummyItemType.AllType);
                items.Insert(0, item);
            }

            // If there are no items at all in the collection, throw an 'All' on the list
            if (items.Count == 0)
            {
                T item = StoreItem.GetDummyItem <T>(DummyItemType.AllType);
                items.Insert(0, item);
            }

            return(items);
        }
Beispiel #2
0
 private void BuildSpecTeamLists()
 {
     m_SpecTeamListWithNone    = HostItemStore.Instance.GetFieldAllowedValues(this, Datastore.PropNameBacklogSpecTeam);
     m_SpecTeamListWithoutNone = m_SpecTeamListWithNone.ToCollection();
     foreach (AllowedValue value in m_SpecTeamListWithoutNone)
     {
         if ((string)value.Value == Constants.c_NoneSpecTeamName)
         {
             m_SpecTeamListWithoutNone.Remove(value);
             break;
         }
     }
 }