本文整理汇总了C#中SchedulerServiceAgent.GetChannelsInGroup方法的典型用法代码示例。如果您正苦于以下问题:C# SchedulerServiceAgent.GetChannelsInGroup方法的具体用法?C# SchedulerServiceAgent.GetChannelsInGroup怎么用?C# SchedulerServiceAgent.GetChannelsInGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SchedulerServiceAgent
的用法示例。
在下文中一共展示了SchedulerServiceAgent.GetChannelsInGroup方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RefreshChannelsInGroup
private void RefreshChannelsInGroup(SchedulerServiceAgent tvSchedulerAgent, ChannelType channelType)
{
try
{
if (_currentChannelGroup != null)
{
_navigatorChannels[channelType].Channels = new List<Channel>(
tvSchedulerAgent.GetChannelsInGroup(_currentChannelGroup.ChannelGroupId, true));
}
else
{
_navigatorChannels[channelType].Channels = new List<Channel>();
}
_navigatorChannels[channelType].ChannelsByNumber.Clear();
_navigatorChannels[channelType].GroupsByChannelNumber.Clear();
}
catch (Exception ex)
{
Log.Error("ChannelNavigator: Error in RefreshChannelsInGroup - {0}", ex.Message);
}
}
示例2: DoShowChannelsCommand
private IMBotMessage DoShowChannelsCommand(IMBotConversation conversation, IList<string> arguments)
{
if (arguments.Count == 0)
{
return new IMBotMessage("Group name or number missing.", IMBotMessage.ErrorColor);
}
using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
{
List<ChannelGroup> groups = GetAllGroups(tvSchedulerAgent, GetChannelType(conversation));
ChannelGroup group = null;
int index;
if (int.TryParse(arguments[0], out index))
{
if (index < 1 || index > groups.Count)
{
return new IMBotMessage("Unknown group number.", IMBotMessage.ErrorColor);
}
group = groups[index - 1];
}
else
{
foreach (ChannelGroup channelGroup in groups)
{
if (channelGroup.GroupName.Equals(arguments[0], StringComparison.CurrentCultureIgnoreCase))
{
group = channelGroup;
break;
}
}
if (group == null)
{
return new IMBotMessage("Unknown group name.", IMBotMessage.ErrorColor);
}
}
Channel[] channels = tvSchedulerAgent.GetChannelsInGroup(group.ChannelGroupId, true);
StringBuilder replyText = new StringBuilder();
replyText.AppendFormat("Channels in {0}:", group.GroupName);
foreach (Channel channel in channels)
{
replyText.AppendLine();
replyText.AppendFormat("{0,3} {1}",
channel.LogicalChannelNumber.HasValue ? channel.LogicalChannelNumber.Value.ToString() : "-",
channel.DisplayName);
}
return new IMBotMessage(replyText.ToString(), true)
{
Footer = "Use 'show guide <number | name> [day-number]' to see the channel guide."
};
}
}
示例3: FindChannelInGroupByNumber
private Channel FindChannelInGroupByNumber(SchedulerServiceAgent tvSchedulerAgent, Guid channelGroupId, int channelNr)
{
return FindChannelByNumber(new List<Channel>(tvSchedulerAgent.GetChannelsInGroup(channelGroupId, true)), channelNr);
}
示例4: GetChannels
private void GetChannels(bool refresh)
{
if (refresh || _channelList == null)
{
_channelList = new List<GuideBaseChannel>();
}
if (_channelList.Count == 0)
{
try
{
using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
{
foreach (Channel chan in tvSchedulerAgent.GetChannelsInGroup(_model.CurrentChannelGroupId, true))
{
GuideBaseChannel tvGuidChannel = new GuideBaseChannel();
tvGuidChannel.channel = chan;
if (tvGuidChannel.channel.VisibleInGuide && tvGuidChannel.channel.ChannelType == _channelType)
{
if (_showChannelNumber)
{
if (_byIndex)
{
tvGuidChannel.channelNum = _channelList.Count + 1;
}
else if (chan.LogicalChannelNumber.HasValue)
{
tvGuidChannel.channelNum = chan.LogicalChannelNumber.Value;
}
}
tvGuidChannel.strLogo = GetChannelLogo(tvGuidChannel.channel);
_channelList.Add(tvGuidChannel);
}
}
}
}
catch { }
if (_channelList.Count == 0)
{
GuideBaseChannel tvGuidChannel = new GuideBaseChannel()
{
channel = new Channel()
{
DisplayName = Utility.GetLocalizedText(TextId.NoChannels),
VisibleInGuide = true
}
};
for (int i = 0; i < 10; ++i)
{
_channelList.Add(tvGuidChannel);
}
}
}
}