GetRadioGuideChannelsForGroup() public method

Gets a list of radio channels sorted by their group
public GetRadioGuideChannelsForGroup ( int groupID ) : List
groupID int
return List
コード例 #1
0
    protected override void GetChannels(bool refresh)
    {
      if (refresh || _channelList == null)
      {
        if (_channelList != null)
        {
          if (_channelList.Count < _channelCount)
          {
            _previousChannelCount = _channelList.Count;
          }
          else
          {
            _previousChannelCount = _channelCount;
          }
        }
        _channelList = new List<GuideChannel>();
      }

      if (_channelList.Count == 0)
      {
        try
        {
          if (Radio.SelectedGroup != null)
          {
            TvBusinessLayer layer = new TvBusinessLayer();
            IList<Channel> channels = layer.GetRadioGuideChannelsForGroup(Radio.SelectedGroup.IdGroup);
            foreach (Channel chan in channels)
            {
              GuideChannel tvGuidChannel = new GuideChannel();
              tvGuidChannel.channel = chan;

              if (tvGuidChannel.channel.VisibleInGuide && tvGuidChannel.channel.IsRadio)
              {
                if (_showChannelNumber)
                {

                  if (_byIndex)
                  {
                    tvGuidChannel.channelNum = _channelList.Count + 1;
                  }
                  else
                  {
                    tvGuidChannel.channelNum = tvGuidChannel.channel.ChannelNumber;
                  }
                }
                tvGuidChannel.strLogo = GetChannelLogo(tvGuidChannel.channel.DisplayName);
                _channelList.Add(tvGuidChannel);
              }
            }
          }
        }
        catch { }

        if (_channelList.Count == 0)
        {
          GuideChannel tvGuidChannel = new GuideChannel();
          tvGuidChannel.channel = new Channel(false, true, 0, DateTime.MinValue, false,
                                              DateTime.MinValue, 0, true, "", GUILocalizeStrings.Get(911), 10000);
          for (int i = 0; i < 10; ++i)
          {
            _channelList.Add(tvGuidChannel);
          }
        }
      }
    }