本文整理汇总了C#中SchedulerServiceAgent.GetCurrentAndNextForGroup方法的典型用法代码示例。如果您正苦于以下问题:C# SchedulerServiceAgent.GetCurrentAndNextForGroup方法的具体用法?C# SchedulerServiceAgent.GetCurrentAndNextForGroup怎么用?C# SchedulerServiceAgent.GetCurrentAndNextForGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchedulerServiceAgent
的用法示例。
在下文中一共展示了SchedulerServiceAgent.GetCurrentAndNextForGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillChannelList
/// <summary>
/// Fill the list with channels
/// </summary>
private void FillChannelList()
{
using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
{
_channelsListControl.Clear();
int i = 0;
int SelectedID = 0;
string ChannelLogo = string.Empty;
if (_currentGroup != null)
{
_currentAndNextPrograms = new List<CurrentAndNextProgram>(
tvSchedulerAgent.GetCurrentAndNextForGroup(_currentGroup.ChannelGroupId, true, true, PluginMain.Navigator.LiveStream));
}
else
{
_currentAndNextPrograms = new List<CurrentAndNextProgram>();
}
Channel currentChannel = PluginMain.Navigator.CurrentChannel;
Channel prevChannel = PluginMain.Navigator.GetPreviousChannel(this.ChannelType);
foreach (CurrentAndNextProgram currentAndNext in _currentAndNextPrograms)
{
i++;
sb.Length = 0;
GUIListItem item = new GUIListItem("");
item.TVTag = currentAndNext.Channel;
sb.Append(currentAndNext.Channel.DisplayName);
ChannelLogo = Utility.GetLogoImage(currentAndNext.Channel, tvSchedulerAgent);
if (!string.IsNullOrEmpty(ChannelLogo))
{
item.IconImageBig = ChannelLogo;
item.IconImage = ChannelLogo;
}
else
{
item.IconImageBig = string.Empty;
item.IconImage = string.Empty;
}
ActiveRecording activeRecording;
if (PluginMain.IsChannelRecording(currentAndNext.Channel.ChannelId, out activeRecording))
{
if (_showStateIcons)
{
item.PinImage = RecordingIcon;
}
else
{
sb.Append(" ");
sb.Append(recordingText);
}
item.IsPlayed = (currentAndNext.LiveState == ChannelLiveState.NotTunable
|| currentAndNext.LiveState == ChannelLiveState.NoFreeCard);
}
else
{
switch (currentAndNext.LiveState)
{
case ChannelLiveState.NotTunable:
case ChannelLiveState.NoFreeCard:
item.IsPlayed = true;
if (_showStateIcons)
{
item.PinImage = UnavailableIcon;
}
else
{
sb.Append(" ");
sb.Append(unavailableText);
}
break;
default:
item.IsPlayed = false;
if (_showStateIcons)
{
item.PinImage = AvailableIcon;
}
break;
}
}
if (currentChannel != null)
{
if (currentChannel.ChannelId == currentAndNext.Channel.ChannelId)
{
item.IsRemote = true;
SelectedID = _channelsListControl.Count;
if (_showStateIcons && item.PinImage != RecordingIcon
&& item.PinImage != UnavailableIcon)
{
//.........这里部分代码省略.........
示例2: CacheMiniGuide
private void CacheMiniGuide()
{
lock (chacheLock)
{
System.Threading.Thread.Sleep(8000);
while (!PluginMain.IsConnected())
{
Thread.Sleep(2000);
}
Log.Debug("CacheChannelsThread: started");
using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
{
List<CurrentAndNextProgram> _currentAndNextPrograms = new List<CurrentAndNextProgram>();
try
{
ChannelGroup currgroup = PluginMain.Navigator.CurrentGroup;
if (currgroup != null)
{
_currentAndNextPrograms = new List<CurrentAndNextProgram>(tvSchedulerAgent.GetCurrentAndNextForGroup(PluginMain.Navigator.CurrentGroup.ChannelGroupId, true, true, null));
}
List<ChannelGroup> groups = PluginMain.Navigator.GetGroups(ChannelType.Television);
foreach (ChannelGroup group in groups)
{
_currentAndNextPrograms = new List<CurrentAndNextProgram>(tvSchedulerAgent.GetCurrentAndNextForGroup(group.ChannelGroupId, true, true, null));
}
}
catch { Log.Error("CacheChannelsThread: error"); }
_currentAndNextPrograms.Clear();
_currentAndNextPrograms = null;
}
Log.Debug("CacheChannelsThread: ended");
}
}