Ejemplo n.º 1
0
 public void ShowPage(string searchText)
 {
     if (this.dataState == DataState.NotLoaded)
     {
         Dictionary <string, VideosSearch.FilterData> filterData = this.GetFilterData();
         int firstFilterLocation = this.GetFirstFilterLocation();
         foreach (KeyValuePair <string, VideosSearch.FilterData> current in filterData)
         {
             List <VideoFilterOption> list = new List <VideoFilterOption>();
             int firstFilterLocation2      = this.GetFirstFilterLocation();
             foreach (KeyValuePair <string, string[]> current2 in current.get_Value().Choices)
             {
                 VideoFilterOption item = new VideoFilterOption(current2.get_Key(), current2.get_Value()[0], firstFilterLocation2++);
                 list.Add(item);
             }
             this.filters.Add(new VideosFilterChoice(current.get_Key(), firstFilterLocation++, list, current.get_Value().UIType, current.get_Value().ValueType));
         }
         this.dataState = DataState.Loading;
     }
     if (searchText != null)
     {
         this.SetKeywords(searchText);
     }
     this.PerformSearch();
 }
Ejemplo n.º 2
0
 public ChoiceData(VideoFilterOption defaultChoice, List <VideoFilterOption> choices, VideoFilterOption choice, string label, int id, ChoiceType uiType)
 {
     this.ChoiceDefault = defaultChoice;
     this.Choices       = choices;
     this.ChoiceMade    = choice;
     this.UILabel       = label;
     this.Id            = id;
     this.UIType        = uiType;
 }
Ejemplo n.º 3
0
        public void OptionSelected(int filterId, int choiceId)
        {
            VideosFilterChoice filterChoice = this.GetFilterChoice(filterId);
            VideoFilterOption  filterOption = this.GetFilterOption(choiceId, filterChoice);

            if (filterOption == null)
            {
                return;
            }
            if (filterChoice.ValueType == FilterType.Tag)
            {
                this.SetTag(filterId.ToString(), filterOption.Value);
            }
            else if (filterChoice.ValueType == FilterType.Date)
            {
                this.ageLimitInDays = -1;
                if (!string.IsNullOrEmpty(filterOption.Value))
                {
                    this.ageLimitInDays = (int)Convert.ToUInt16(filterOption.Value, CultureInfo.InvariantCulture);
                }
            }
            this.PerformSearch();
        }
Ejemplo n.º 4
0
 public VideoFilterOption(VideoFilterOption other) : this(other.UILabel, other.Value, other.Id)
 {
 }