示例#1
0
 private VideoFilterOption GetFilterOption(int choiceId, VideosFilterChoice currFilter)
 {
     if (currFilter == null)
     {
         return(null);
     }
     foreach (VideoFilterOption current in currFilter.Options)
     {
         if (choiceId == current.Id)
         {
             return(current);
         }
     }
     return(null);
 }
示例#2
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();
        }