• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SchedulerServiceAgent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SchedulerServiceAgent的典型用法代码示例。如果您正苦于以下问题:C# SchedulerServiceAgent类的具体用法?C# SchedulerServiceAgent怎么用?C# SchedulerServiceAgent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SchedulerServiceAgent类属于命名空间,在下文中一共展示了SchedulerServiceAgent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SetMusicProperties

        public static void SetMusicProperties(string chanName, Guid channelId)
        {
            string logo = string.Empty;
            if (channelId != Guid.Empty && chanName != string.Empty)
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    logo = Utility.GetLogoImage(channelId, chanName, tvSchedulerAgent);
                }
            }
            else
            {
                chanName = string.Empty;
            }

            if (string.IsNullOrEmpty(logo))
            {
                logo = "defaultMyRadioBig.png";
            }

             GUIPropertyManager.RemovePlayerProperties();
             GUIPropertyManager.SetProperty("#Play.Current.Thumb", logo);
             GUIPropertyManager.SetProperty("#Play.Current.ArtistThumb", chanName);
             GUIPropertyManager.SetProperty("#Play.Current.Album", chanName);
             GUIPropertyManager.SetProperty("#Play.Current.Title", chanName);
             GUIPropertyManager.SetProperty("#Play.Current.Artist", chanName);
        }
开发者ID:Glenn-1990,项目名称:ARGUS-TV-Clients,代码行数:27,代码来源:RadioHome.cs


示例2: GetScheduleNames

 private void GetScheduleNames(SchedulerServiceAgent tvSchedulerAgent, ScheduleType type)
 {
     ScheduleSummary[] schedules = tvSchedulerAgent.GetAllSchedules(ChannelType.Television, type, false);
     foreach (ScheduleSummary schedule in schedules)
     {
         _scheduleNames.Add(schedule.ScheduleId, schedule.Name);
     }
     schedules = tvSchedulerAgent.GetAllSchedules(ChannelType.Radio, type, false);
     foreach (ScheduleSummary schedule in schedules)
     {
         _scheduleNames.Add(schedule.ScheduleId, schedule.Name);
     }
 }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:13,代码来源:ScheduleNamesCache.cs


示例3: DoDeleteScheduleCommand

        private IMBotMessage DoDeleteScheduleCommand(IMBotConversation conversation, IList<string> arguments)
        {
            if (arguments.Count == 0)
            {
                return new IMBotMessage("Program number is missing.", IMBotMessage.ErrorColor);
            }

            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            {
                UpcomingProgram upcomingRecording;
                IMBotMessage result = FindUpcomingRecording(tvSchedulerAgent, conversation, arguments, out upcomingRecording);
                if (result == null)
                {
                    StringBuilder replyText = new StringBuilder();
                    tvSchedulerAgent.DeleteSchedule(upcomingRecording.ScheduleId);
                    replyText.Append("Deleted schedule for ");
                    Utility.AppendProgramDetails(replyText, upcomingRecording.Channel, upcomingRecording);
                    replyText.Append(".");
                    result = new IMBotMessage(replyText.ToString());
                }
                return result;
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:23,代码来源:IMCommands.cs


示例4: ConnectToArgusTV

        private void ConnectToArgusTV()
        {
            DisconnectFromArgusTV();

            _plugin.InitializeArgusTVConnection(this);
            _notConnectedPanel.Visible = !_plugin.IsArgusTVConnectionInitialized;
            _channelsPanel.Visible = _plugin.IsArgusTVConnectionInitialized;

            LoadUncPaths();

            if (_plugin.IsArgusTVConnectionInitialized)
            {
                _tvSchedulerAgent = new SchedulerServiceAgent();
            }
        }
开发者ID:ARGUS-TV,项目名称:ARGUS-TV-Recorders,代码行数:15,代码来源:SetupForm.cs


示例5: EnsureGuideChannelForDvbEpg

 private static void EnsureGuideChannelForDvbEpg(SchedulerServiceAgent tvSchedulerAgent, GuideServiceAgent tvGuideAgent, Channel channel, TvDatabase.Channel mpChannel)
 {
     if (!channel.GuideChannelId.HasValue)
     {
         string externalId = mpChannel.ExternalId;
         if (String.IsNullOrEmpty(externalId))
         {
             externalId = mpChannel.DisplayName;
         }
         channel.GuideChannelId = tvGuideAgent.EnsureChannel(externalId, mpChannel.DisplayName, channel.ChannelType);
         tvSchedulerAgent.AttachChannelToGuide(channel.ChannelId, channel.GuideChannelId.Value);
     }
 }
开发者ID:dot-i,项目名称:ARGUS-TV-Recorders,代码行数:13,代码来源:TvServerPlugin.cs


示例6: RefreshGroups

        private void RefreshGroups(ChannelType channelType)
        {
            try
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    List<ChannelGroup> groups = new List<ChannelGroup>(tvSchedulerAgent.GetAllChannelGroups(channelType, true));
                    if (_currentChannelGroup != null
                        && _currentChannelGroup.ChannelGroupId != ChannelGroup.AllTvChannelsGroupId
                        && _currentChannelGroup.ChannelGroupId != ChannelGroup.AllRadioChannelsGroupId)
                    {
                        bool currentFound = false;
                        foreach (ChannelGroup group in groups)
                        {
                            if (group.ChannelGroupId == _currentChannelGroup.ChannelGroupId)
                            {
                                currentFound = true;
                                break;
                            }
                        }
                        if (!currentFound)
                        {
                            _currentChannelGroup = null;
                        }
                    }

                    bool hideAllChannelsGroup = false;
                    using (Settings xmlreader = new MPSettings())
                    {
                        hideAllChannelsGroup = xmlreader.GetValueAsBool("mytv", "hideAllChannelsGroup", false);
                    }

                    if (!hideAllChannelsGroup || groups.Count == 0)
                    {
                        groups.Add(new ChannelGroup(
                            channelType == ChannelType.Television ? ChannelGroup.AllTvChannelsGroupId : ChannelGroup.AllRadioChannelsGroupId,
                            (int)channelType, Utility.GetLocalizedText(TextId.AllChannels), true, int.MaxValue, 0));
                    }

                    _navigatorChannels[channelType].Groups = groups;

                    if (_currentChannelGroup == null && _navigatorChannels[channelType].Groups.Count > 0)
                    {
                        _currentChannelGroup = _navigatorChannels[channelType].Groups[0];
                        RefreshChannelsInGroup(tvSchedulerAgent, channelType);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error("ChannelNavigator: Error in RefreshChannelGroups - {0}", ex.Message);
            }
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:53,代码来源:ChannelNavigator.cs


示例7: RefreshChannelsInGroup

 private void RefreshChannelsInGroup(ChannelType channelType)
 {
     using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
     {
         RefreshChannelsInGroup(tvSchedulerAgent, channelType);
     }
 }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:7,代码来源:ChannelNavigator.cs


示例8: ChannelTuneFailedNotifyUser

        private void ChannelTuneFailedNotifyUser(LiveStreamResult result, Channel channel)
        {
            string TuningResult = string.Empty;
            switch (result)
            {
                case LiveStreamResult.ChannelTuneFailed:
                    TuningResult = (Utility.GetLocalizedText(TextId.ChannelTuneFailed));
                    break;

                case LiveStreamResult.NoFreeCardFound:
                    TuningResult = (Utility.GetLocalizedText(TextId.NoFreeCardFound));
                    break;

                case LiveStreamResult.NotSupported:
                    TuningResult = (Utility.GetLocalizedText(TextId.NotSupported));
                    break;

                case LiveStreamResult.NoRetunePossible:
                    TuningResult = (Utility.GetLocalizedText(TextId.NoRetunePossible));
                    break;

                case LiveStreamResult.IsScrambled:
                    TuningResult = (Utility.GetLocalizedText(TextId.IsScrambled));
                    break;

                case LiveStreamResult.UnknownError:
                    TuningResult = (Utility.GetLocalizedText(TextId.UnknownError));
                    break;
            }

            if (GUIWindowManager.ActiveWindow == (int)(int)GUIWindow.Window.WINDOW_TVFULLSCREEN)
            {
                // If failed and wasPlaying TV, left screen as it is and show zaposd with error message
                GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_TV_ERROR_NOTIFY, GUIWindowManager.ActiveWindow, 0,
                                                0, 0, 0,
                                                null);

                msg.SendToTargetWindow = true;
                msg.Object = TuningResult; // forward error info object
                msg.TargetWindowId = (int)(int)GUIWindow.Window.WINDOW_TVFULLSCREEN;
                GUIGraphicsContext.SendMessage(msg);
            }
            else
            {
                // if not fulscreen, show notify dialog with the error message
                string caption = string.Empty;
                string tvlogo = string.Empty;
                if (channel != null)
                {
                    _navigatorChannels[_currentChannel.ChannelType].PreviousChannel = channel;
                    _currentChannel = null;

                    using (SchedulerServiceAgent SchedulerAgent = new SchedulerServiceAgent())
                    {
                        tvlogo = Utility.GetLogoImage(channel, SchedulerAgent);
                    }

                    if (channel.ChannelType == ChannelType.Television)
                        caption = GUILocalizeStrings.Get(605) + " - " + channel.DisplayName;
                    else
                        caption = GUILocalizeStrings.Get(665) + " - " + channel.DisplayName;
                }

                GUIDialogNotify pDlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY);
                if (pDlgNotify != null)
                {
                    pDlgNotify.Reset();
                    pDlgNotify.ClearAll();
                    pDlgNotify.SetHeading(caption);
                    if (!string.IsNullOrEmpty(TuningResult))
                    {
                        pDlgNotify.SetText(TuningResult);
                    }
                    pDlgNotify.SetImage(tvlogo);
                    pDlgNotify.TimeOut = 5;
                    pDlgNotify.DoModal(GUIWindowManager.ActiveWindow);
                }
            }
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:79,代码来源:ChannelNavigator.cs


示例9: DoShowUpcomingCommand

        private IMBotMessage DoShowUpcomingCommand(IMBotConversation conversation, ScheduleType type)
        {
            if (type == ScheduleType.Recording)
            {
                using (ControlServiceAgent tvControlAgent = new ControlServiceAgent())
                {
                    UpcomingRecording[] upcomingRecordings = tvControlAgent.GetAllUpcomingRecordings(UpcomingRecordingsFilter.Recordings, false);

                    StringBuilder replyText = new StringBuilder();

                    if (upcomingRecordings.Length > 0)
                    {
                        int index = 0;
                        foreach (UpcomingRecording upcomingRecording in upcomingRecordings)
                        {
                            if (replyText.Length > 0)
                            {
                                replyText.AppendLine();
                            }

                            PluginService pluginService = null;
                            if (upcomingRecording.CardChannelAllocation != null)
                            {
                                pluginService =
                                    RecorderTunersCache.GetRecorderTunerById(upcomingRecording.CardChannelAllocation.RecorderTunerId);
                            }

                            replyText.AppendFormat("{0,3}» ", ++index);
                            Utility.AppendProgramDetails(replyText, upcomingRecording.Program.Channel, upcomingRecording.Program);
                            replyText.AppendFormat(" [{0}]", pluginService == null ? "-" : pluginService.Name);
                        }

                        conversation.Session[SessionKey.Programs] = new Session.Programs(upcomingRecordings);

                        return new IMBotMessage(replyText.ToString(), true)
                        {
                            Footer = "Use 'cancel', 'uncancel' or 'delete schedule' with <number>."
                        };
                    }
                }
            }
            else
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    UpcomingProgram[] upcomingPrograms = tvSchedulerAgent.GetAllUpcomingPrograms(type, false);

                    StringBuilder replyText = new StringBuilder();

                    if (upcomingPrograms.Length > 0)
                    {
                        int index = 0;
                        foreach (UpcomingProgram upcomingProgram in upcomingPrograms)
                        {
                            if (replyText.Length > 0)
                            {
                                replyText.AppendLine();
                            }
                            replyText.AppendFormat("{0,3}» ", ++index);
                            Utility.AppendProgramDetails(replyText, upcomingProgram.Channel, upcomingProgram);
                        }

                        conversation.Session[SessionKey.Programs] = new Session.Programs(upcomingPrograms);

                        return new IMBotMessage(replyText.ToString(), true)
                        {
                            Footer = "Use 'record', 'cancel', 'uncancel' or 'delete schedule' with <number>."
                        };
                    }
                }
            }
            return new IMBotMessage("There are no upcoming " + type.ToString().ToLowerInvariant() + "s.");
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:73,代码来源:IMCommands.cs


示例10: DoShowGuideCommand

        private IMBotMessage DoShowGuideCommand(IMBotConversation conversation, IList<string> arguments)
        {
            if (arguments.Count == 0)
            {
                return new IMBotMessage("Channel name or number missing.", IMBotMessage.ErrorColor);
            }

            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            using (GuideServiceAgent tvGuideAgent = new GuideServiceAgent())
            {
                Channel selectedChannel = null;
                ChannelType channelType = GetChannelType(conversation);

                int lcn;
                if (int.TryParse(arguments[0], out lcn))
                {
                    selectedChannel = tvSchedulerAgent.GetChannelByLogicalChannelNumber(channelType, lcn);
                    if (selectedChannel == null)
                    {
                        return new IMBotMessage("Unknown channel number.", IMBotMessage.ErrorColor);
                    }
                }
                else
                {
                    selectedChannel = tvSchedulerAgent.GetChannelByDisplayName(channelType, arguments[0]);
                    if (selectedChannel == null)
                    {
                        return new IMBotMessage("Unknown channel name.", IMBotMessage.ErrorColor);
                    }
                }

                if (selectedChannel.GuideChannelId.HasValue)
                {
                    DateTime lowerTime = DateTime.Today;
                    if (arguments.Count > 1)
                    {
                        int dayNumber;
                        if (!int.TryParse(arguments[1], out dayNumber))
                        {
                            return new IMBotMessage("Bad day number, use 0 for today, 1 for tomorrow, etc...", IMBotMessage.ErrorColor);
                        }
                        lowerTime = lowerTime.AddDays(dayNumber);
                    }

                    DateTime upperTime = lowerTime.AddDays(1);
                    if (lowerTime.Date == DateTime.Today)
                    {
                        lowerTime = DateTime.Now;
                    }

                    Dictionary<Guid, UpcomingGuideProgram> upcomingRecordingsById = BuildUpcomingDictionary(
                        tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Recording, true));
                    Dictionary<Guid, UpcomingGuideProgram> upcomingAlertsById = BuildUpcomingDictionary(
                        tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Alert, false));
                    Dictionary<Guid, UpcomingGuideProgram> upcomingSuggestionsById = BuildUpcomingDictionary(
                        tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Suggestion, false));

                    GuideProgramSummary[] programs = tvGuideAgent.GetChannelProgramsBetween(selectedChannel.GuideChannelId.Value, lowerTime, upperTime);
                    if (programs.Length == 0)
                    {
                        return new IMBotMessage(String.Format(CultureInfo.CurrentCulture, "No guide data for {0} on {1}.", selectedChannel.DisplayName, lowerTime.ToLongDateString()),
                            IMBotMessage.ErrorColor);
                    }
                    else
                    {
                        StringBuilder replyText = new StringBuilder();
                        replyText.AppendFormat("{0} on {1}:", lowerTime.ToLongDateString(), selectedChannel.DisplayName);
                        int index = 0;
                        foreach (GuideProgramSummary program in programs)
                        {
                            replyText.AppendLine();
                            replyText.AppendFormat("{0,3}» ", ++index);
                            string appendText = AppendProgramIndicatorsPrefix(replyText,
                                program.GetUniqueUpcomingProgramId(selectedChannel.ChannelId),
                                upcomingRecordingsById, upcomingAlertsById, upcomingSuggestionsById);
                            Utility.AppendProgramDetails(replyText, program);
                            replyText.Append(appendText);
                        }

                        conversation.Session[SessionKey.Programs] = new Session.Programs(selectedChannel, programs);

                        return new IMBotMessage(replyText.ToString(), true)
                        {
                            Footer = "Use 'record', 'cancel', 'uncancel' or 'delete schedule' with <number>."
                        };
                    }
                }
                else
                {
                    return new IMBotMessage("Channel has no guide data.", IMBotMessage.ErrorColor);
                }
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:93,代码来源:IMCommands.cs


示例11: 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


示例12: DoShowChannelGroupsCommand

        private IMBotMessage DoShowChannelGroupsCommand(IMBotConversation conversation, IList<string> arguments)
        {
            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            {
                List<ChannelGroup> groups = GetAllGroups(tvSchedulerAgent, GetChannelType(conversation));

                StringBuilder replyText = new StringBuilder();

                int index = 1;
                foreach (ChannelGroup group in groups)
                {
                    if (replyText.Length > 0)
                    {
                        replyText.AppendLine();
                    }
                    replyText.AppendFormat("{0,3}» {1}", index++, group.GroupName);
                }

                return new IMBotMessage(replyText.ToString(), true)
                {
                    Footer = "Use 'show channels <number | name>' to see the programs in a group."
                };
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:24,代码来源:IMCommands.cs


示例13: DoSearchResults

        private IMBotMessage DoSearchResults(IMBotConversation conversation, int resultNumber)
        {
            if (!conversation.Session.ContainsKey(SessionKey.FoundTitles))
            {
                return new IMBotMessage("No search results found, use search command.", IMBotMessage.ErrorColor);
            }

            string[] titles = (string[])conversation.Session[SessionKey.FoundTitles];

            if (resultNumber < 1
                || resultNumber > titles.Length)
            {
                return new IMBotMessage("Bad search result number.", IMBotMessage.ErrorColor);
            }

            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            {
                Dictionary<Guid, UpcomingGuideProgram> upcomingRecordingsById = BuildUpcomingDictionary(
                    tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Recording, true));
                Dictionary<Guid, UpcomingGuideProgram> upcomingAlertsById = BuildUpcomingDictionary(
                    tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Alert, false));
                Dictionary<Guid, UpcomingGuideProgram> upcomingSuggestionsById = BuildUpcomingDictionary(
                    tvSchedulerAgent.GetUpcomingGuidePrograms(ScheduleType.Suggestion, false));

                ChannelProgram[] programs = tvSchedulerAgent.SearchGuideByTitle(GetChannelType(conversation), titles[resultNumber - 1], false);

                StringBuilder replyText = new StringBuilder();
                int index = 0;
                foreach (ChannelProgram program in programs)
                {
                    if (replyText.Length > 0)
                    {
                        replyText.AppendLine();
                    }
                    replyText.AppendFormat("{0,3}» ", ++index);
                    string appendText = AppendProgramIndicatorsPrefix(replyText, program.GetUniqueUpcomingProgramId(),
                        upcomingRecordingsById, upcomingAlertsById, upcomingSuggestionsById);
                    Utility.AppendProgramDetails(replyText, program.Channel, program);
                    replyText.Append(appendText);
                }

                conversation.Session[SessionKey.Programs] = new Session.Programs(programs);

                return new IMBotMessage(replyText.ToString(), true)
                {
                    Footer = "Use 'record', 'cancel', 'uncancel' or 'delete schedule' with <number>."
                };
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:49,代码来源:IMCommands.cs


示例14: DoSearchCommand

        private IMBotMessage DoSearchCommand(IMBotConversation conversation, IList<string> arguments)
        {
            if (arguments.Count == 0)
            {
                return new IMBotMessage("Search text or result number is missing.", IMBotMessage.ErrorColor);
            }

            int resultNumber;
            if (int.TryParse(arguments[0], out resultNumber))
            {
                return DoSearchResults(conversation, resultNumber);
            }

            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            {
                string searchText = arguments[0];
                if (searchText.StartsWith(@"\"))
                {
                    searchText = searchText.Substring(1);
                }

                string[] titles = tvSchedulerAgent.GetTitlesByPartialTitle(GetChannelType(conversation), searchText, false);

                StringBuilder replyText = new StringBuilder();
                replyText.AppendFormat("Found {0} in the following titles:", searchText);
                int index = 0;
                foreach (string title in titles)
                {
                    replyText.AppendLine();
                    replyText.AppendFormat("{0,3}» {1}", ++index, title);
                }

                conversation.Session.Remove(SessionKey.Programs);
                conversation.Session[SessionKey.FoundTitles] = titles;

                return new IMBotMessage(replyText.ToString(), true)
                {
                    Footer = "Use 'search <number>' to see the programs."
                };
            }
        }
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:41,代码来源:IMCommands.cs


示例15: DoRecordCommand

        private IMBotMessage DoRecordCommand(IMBotConversation conversation, IList<string> arguments)
        {
            if (arguments.Count == 0)
            {
                return new IMBotMessage("Program number missing.", IMBotMessage.ErrorColor);
            }

            using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
            {
                RepeatingType repeatingType = RepeatingType.None;
                if (arguments.Count > 1)
                {
                    switch (arguments[1].ToLowerInvariant())
                    {
                        case "once": case "o": repeatingType = RepeatingType.Once; break;
                        case "daily": case "d": repeatingType = RepeatingType.Daily; break;
                        case "weekly": case "w": repeatingType = RepeatingType.Weekly; break;
                        case "workingdays": case "wd": repeatingType = RepeatingType.WorkingDays; break;
                        case "weekends": case "we": repeatingType = RepeatingType.Weekends; break;
                        case "anytime": case "a": repeatingType = RepeatingType.AnyTime; break;
                    }
                }

                int programNumber;
                if (repeatingType == RepeatingType.None
                    || !int.TryParse(arguments[0], out programNumber))
                {
                    return new IMBotMessage("Please specify program number and once, daily, weekly, workingdays, weekends or anytime.", IMBotMessage.ErrorColor);
                }

                Session.Programs sessionPrograms = null;
                if (conversation.Session.ContainsKey(SessionKey.Programs))
                {
                    sessionPrograms = conversation.Session[SessionKey.Programs] as Session.Programs;
                }

                IProgramSummary program = null;
                Channel channel = null;

                if (sessionPrograms != null)
                {
                    program = sessionPrograms.GetProgramAt(programNumber, out channel);
                    if (program == null)
                    {
                        return new IMBotMessage("Bad program number.", IMBotMessage.ErrorColor);
                    }
                }
                else
                {
                    return new IMBotMessage("No programs.", IMBotMessage.ErrorColor);
                }

                Schedule schedule = tvSchedulerAgent.CreateNewSchedule(GetChannelType(conversation), ScheduleType.Recording);

                bool newEpisodesOnly = arguments.Count > 2 && arguments[2].Equals("new", StringComparison.CurrentCultureIgnoreCase);
                string repeatingText = String.Empty;

                if (repeatingType == RepeatingType.Once)
                {
                    schedule.Name = GuideProgram.CreateProgramTitle(program.Title, program.SubTitle, program.EpisodeNumberDisplay);
                    schedule.Rules.Add(ScheduleRuleType.OnDate, program.StartTime.Date);
                    schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(program.StartTime.TimeOfDay));
                    if (!String.IsNullOrEmpty(program.SubTitle))
                    {
                        schedule.Rules.Add(ScheduleRuleType.SubTitleEquals, program.SubTitle);
                    }
                    else if (!String.IsNullOrEmpty(program.EpisodeNumberDisplay))
                    {
                        schedule.Rules.Add(ScheduleRuleType.EpisodeNumberEquals, program.EpisodeNumberDisplay);
                    }
                    newEpisodesOnly = false;
                }
                else if (repeatingType == RepeatingType.AnyTime)
                {
                    schedule.Name = program.Title + " (Any Time)";
                    repeatingText = " any time";
                }
                else if (repeatingType == RepeatingType.Weekly)
                {
                    schedule.Name = program.Title + " (Weekly)";
                    schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, GetDaysOfWeek(program.StartTime));
                    schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(program.StartTime.TimeOfDay));
                    repeatingText = " weekly";
                }
                else if (repeatingType == RepeatingType.WorkingDays)
                {
                    schedule.Name = program.Title + " (Mon-Fri)";
                    schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, ScheduleDaysOfWeek.WorkingDays);
                    schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(program.StartTime.TimeOfDay));
                    repeatingText = " Mon-Fri";
                }
                else if (repeatingType == RepeatingType.Weekends)
                {
                    schedule.Name = program.Title + " (Sat-Sun)";
                    schedule.Rules.Add(ScheduleRuleType.DaysOfWeek, ScheduleDaysOfWeek.Weekends);
                    schedule.Rules.Add(ScheduleRuleType.AroundTime, new ScheduleTime(program.StartTime.TimeOfDay));
                    repeatingText = " Sat-Sun";
                }
                else if (repeatingType == RepeatingType.Weekly)
                {
//.........这里部分代码省略.........
开发者ID:ElRakiti,项目名称:ARGUS-TV,代码行数:101,代码来源:IMCommands.cs


示例16: TuneLiveStream

        private void TuneLiveStream(Channel channel)
        {
            Log.Debug("ChannelNavigator: TuneLiveStream(), channel = {0}", channel.DisplayName);
            if (channel != null)
            {
                using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                {
                    LiveStream liveStream = _liveStream;
                    CurrentAndNextProgram currentAndNext = tvSchedulerAgent.GetCurrentAndNextForChannel(channel.ChannelId, true, _liveStream);//null);

                    _currentChannel = channel;
                    _doingChannelChange = true;
                    RenderBlackImage();

                    if (liveStream != null)
                    {
                        try
                        {
                            g_Player.PauseGraph();
                            g_Player.OnZapping(0x80);

                            result = this.ControlAgent.TuneLiveStream(channel, ref liveStream);
                            Log.Debug("ChannelNavigator: First try to re-tune the existing TV stream (staying on the same card), result = {0}", result);

                            if (result == LiveStreamResult.Succeeded)
                            {
                                if (_isAnalog)
                                    g_Player.OnZapping(-1);

                                double duration = g_Player.Duration;
                                if (g_Player.Duration < 0.0)
                                    result = LiveStreamResult.UnknownError;
                                else
                                {
                                    g_Player.SeekAbsolute(duration);
                                    g_Player.ContinueGraph();
                                }
                            }
                            else if (result == LiveStreamResult.NoRetunePossible)// not mapped to card, card in use by recorder or other user ---> start new stream
                            {
                                // Now re-try the new channel with a new stream.
                                Log.Debug("ChannelNavigator: Seems a re-tune has failed, stop the current stream and start a new one");
                                SilentlyStopLiveStream(liveStream);
                                result = StartAndPlayNewLiveStream(channel, liveStream);
                            }
                        }
                        catch
                        {
                            result = LiveStreamResult.UnknownError;
                            Log.Error("ChannelNavigator: TuneLiveStream error");
                        }
                    }
                    else
                    {
                        result = StartAndPlayNewLiveStream(channel,liveStream);
                    }

                    _doingChannelChange = false;
                    if (result == LiveStreamResult.Succeeded)
                    {
                        _lastChannelChangeFailed = false;
                        StopRenderBlackImage();
                    }
                    else
                    {
                        _lastChannelChangeFailed = true;
                        SilentlyStopLiveStream(liveStream);
                        ChannelTuneFailedNotifyUser(result, channel);
                    }
                }
            }
        }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:72,代码来源:ChannelNavigator.cs


示例17: GetChannelByNumber

 public Channel GetChannelByNumber(ChannelType channelType, int channelNr, out ChannelGroup channelGroup)
 {
     channelGroup = _currentChannelGroup;
     if (_navigatorChannels[channelType].ChannelsByNumber.ContainsKey(channelNr))
     {
         channelGroup = _navigatorChannels[channelType].GroupsByChannelNumber[channelNr];
         return _navigatorChannels[channelType].ChannelsByNumber[channelNr];
     }
     Channel channel = null;
     if (_navigatorChannels[channelType].Channels != null)
     {
         channel = FindChannelByNumber(_navigatorChannels[channelType].Channels, channelNr);
         if (channel == null)
         {
             try
             {
                 using (SchedulerServiceAgent tvSchedulerAgent = new SchedulerServiceAgent())
                 {
                     foreach (ChannelGroup group in _navigatorChannels[channelType].Groups)
                     {
                         if (group != _currentChannelGroup)
                         {
                             channel = FindChannelInGroupByNumber(tvSchedulerAgent, group.ChannelGroupId, channelNr);
                             if (channel != null)
                             {
                                 channelGroup = group;
                                 break;
                             }
                         }
                     }
                 }
             }
             catch (Exception ex)
             {
                 Log.Error("ChannelNavigator: Error in GetChannelByNumber - {0}", ex.Message);
             }
         }
     }
     _navigatorChannels[channelType].ChannelsByNumber[channelNr] = channel;
     _navigatorChannels[channelType].GroupsByChannelNumber[channelNr] = channelGroup;
     return channel;
 }
开发者ID:Rpatrishh,项目名称:ARGUS-TV-Clients,代码行数:42,代码来源:ChannelNavigator.cs


示例18: 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;
               

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Schema类代码示例发布时间:2022-05-24
下一篇:
C# SchedulerInstruction类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap