Exemple #1
0
 public void UpdateFiltersList()
 {
     if (this._filterList == null)
     {
         return;
     }
     if (_searchResultFilterCommandTypes == null)
     {
         _searchResultFilterCommandTypes = new List <SearchResultFilterCommand>();
         _searchResultFilterCommandTypes.Add(SearchResultFilter.All);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Artists);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Albums);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Tracks);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.MusicVideos);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.TVShows);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Movies);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.OtherVideo);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Podcasts);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Playlists);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Channels);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.WindowsPhoneApps);
         _searchResultFilterCommandTypes.Add(SearchResultFilter.Profile);
     }
     this._filterList.Options.Clear();
     for (int index = 0; index < _searchResultFilterCommandTypes.Count; ++index)
     {
         SearchResultFilterCommand filterCommandType = _searchResultFilterCommandTypes[index];
         if (filterCommandType.HasResults)
         {
             this._filterList.Options.Add(filterCommandType);
         }
     }
 }
Exemple #2
0
        private void FilterListChosenChanged(object sender, EventArgs args)
        {
            if (this._filterList == null)
            {
                return;
            }
            SearchResultFilterCommand chosenValue = (SearchResultFilterCommand)this._filterList.ChosenValue;

            if (chosenValue == null)
            {
                return;
            }
            this.SelectedFilterType = chosenValue.Type;
        }