本文整理汇总了C#中TvDatabase.TvBusinessLayer.GetTVGuideChannelsForGroup方法的典型用法代码示例。如果您正苦于以下问题:C# TvBusinessLayer.GetTVGuideChannelsForGroup方法的具体用法?C# TvBusinessLayer.GetTVGuideChannelsForGroup怎么用?C# TvBusinessLayer.GetTVGuideChannelsForGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TvDatabase.TvBusinessLayer
的用法示例。
在下文中一共展示了TvBusinessLayer.GetTVGuideChannelsForGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChannelListByGroup
private List<Channel> GetChannelListByGroup()
{
int idGroup = TVHome.Navigator.CurrentGroup.IdGroup;
if (_tvGroupChannelListCache == null)
{
_tvGroupChannelListCache = new Dictionary<int, List<Channel>>();
}
List<Channel> channels = null;
if (_tvGroupChannelListCache.TryGetValue(idGroup, out channels)) //already in cache ? then return it.
{
Log.Debug("TvMiniGuide: GetChannelListByGroup returning cached version of channels.");
return channels;
}
else //not in cache, fetch it and update cache, then return.
{
TvBusinessLayer layer = new TvBusinessLayer();
List<Channel> tvChannelList = layer.GetTVGuideChannelsForGroup(idGroup);
if (tvChannelList != null)
{
Log.Debug("TvMiniGuide: GetChannelListByGroup caching channels from DB.");
_tvGroupChannelListCache.Add(idGroup, tvChannelList);
return tvChannelList;
}
}
return new List<Channel>();
}
示例2: UpdateChannelStatesForUsers
private void UpdateChannelStatesForUsers()
{
TvBusinessLayer layer = new TvBusinessLayer();
//System.Diagnostics.Debugger.Launch();
// this section makes sure that all users are updated in regards to channel states.
ChannelStates channelStates = new ChannelStates(layer, this);
if (channelStates != null)
{
IList<ChannelGroup> groups = ChannelGroup.ListAll();
// populating _tvChannelListGroups is only done once as is therefor cached.
if (_tvChannelListGroups == null)
{
foreach (ChannelGroup group in groups)
{
// we will only update user created groups, since it will often have fewer channels than "all channels"
// going into "all channels" group in mini EPG will always be slower.
if (group.GroupName.Equals(TvConstants.TvGroupNames.AllChannels))
continue;
if (_tvChannelListGroups == null)
{
_tvChannelListGroups = layer.GetTVGuideChannelsForGroup(group.IdGroup);
}
else
{
IList<Channel> tvChannelList = layer.GetTVGuideChannelsForGroup(group.IdGroup);
foreach (Channel ch in tvChannelList)
{
bool exists = _tvChannelListGroups.Exists(delegate(Channel c) { return c.IdChannel == ch.IdChannel; });
if (!exists)
{
_tvChannelListGroups.Add(ch);
}
}
}
}
}
channelStates.SetChannelStates(_cards, _tvChannelListGroups, true, this);
}
}
示例3: GetChannels
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 (TVHome.Navigator.CurrentGroup != null)
{
TvBusinessLayer layer = new TvBusinessLayer();
IList<Channel> channels = layer.GetTVGuideChannelsForGroup(TVHome.Navigator.CurrentGroup.IdGroup);
foreach (Channel chan in channels)
{
GuideChannel tvGuidChannel = new GuideChannel();
tvGuidChannel.channel = chan;
if (tvGuidChannel.channel.VisibleInGuide && tvGuidChannel.channel.IsTv)
{
if (_showChannelNumber)
{
if (_byIndex)
{
tvGuidChannel.channelNum = _channelList.Count + 1;
}
else
{
tvGuidChannel.channelNum = chan.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);
}
}
}
}
示例4: GetAllChannelStatesForGroup
/// <summary>
/// Fetches all channel states for a specific group
/// </summary>
/// <param name="idGroup"></param>
/// <param name="user"></param>
public Dictionary<int, ChannelState> GetAllChannelStatesForGroup(int idGroup, IUser user)
{
if (idGroup < 1)
{
return null;
}
if (user == null)
{
return null;
}
TvBusinessLayer layer = new TvBusinessLayer();
IList<Channel> tvChannelList = layer.GetTVGuideChannelsForGroup(idGroup);
if (tvChannelList == null || tvChannelList.Count == 0)
return null;
Dictionary<int, ChannelState> channelStatesList = new Dictionary<int, ChannelState>();
ChannelStates channelStates = new ChannelStates(layer, this);
if (channelStates != null)
{
channelStatesList = channelStates.GetChannelStates(_cards, tvChannelList, ref user, true, this);
}
return channelStatesList;
}