当前位置: 首页>>代码示例>>C#>>正文


C# SchedulerServiceAgent.GetChannelsInGroup方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:21,代码来源:ChannelNavigator.cs

示例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."
                };
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:57,代码来源:IMCommands.cs

示例3: FindChannelInGroupByNumber

 private Channel FindChannelInGroupByNumber(SchedulerServiceAgent tvSchedulerAgent, Guid channelGroupId, int channelNr)
 {
     return FindChannelByNumber(new List<Channel>(tvSchedulerAgent.GetChannelsInGroup(channelGroupId, true)), channelNr);
 }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:4,代码来源:ChannelNavigator.cs

示例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);
                    }
                }
            }
        }
开发者ID:dot-i,项目名称:ARGUS-TV-Clients,代码行数:56,代码来源:GuideBase.cs


注:本文中的SchedulerServiceAgent.GetChannelsInGroup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。