Esempio n. 1
0
        private void GuidePanel_Load(object sender, EventArgs e)
        {
            try
            {
                _inLoad = true;

                Cursor.Current = Cursors.WaitCursor;

                _model = new GuideModel();
                _controller = new GuideController(_model);

                ChannelType channelType = ChannelType.Television;
                if (MainForm.Session.ContainsKey(SessionKey.ChannelType))
                {
                    channelType = (ChannelType)MainForm.Session[SessionKey.ChannelType];
                }
                _controller.Initialize(channelType, 24, ArgusTV.WinForms.Controls.EpgControl.EpgHoursOffset, "All Channels");

                _channelTypeComboBox.SelectedIndex = (int)_model.ChannelType;

                _groupsBindingSource.DataSource = _model.ChannelGroups;
                _channelGroupsComboBox.DisplayMember = "GroupName";
                _channelGroupsComboBox.ValueMember = "ChannelGroupId";
                if (MainForm.Session.ContainsKey(SessionKey.ChannelGroupId))
                {
                    _channelGroupsComboBox.SelectedValue = (Guid)MainForm.Session[SessionKey.ChannelGroupId];
                }

                DateTime guideDate = GetCurrentGuideDate();

                if (MainForm.Session.ContainsKey(SessionKey.GuideDate))
                {
                    guideDate = (DateTime)MainForm.Session[SessionKey.GuideDate];
                }
                _gotoNowTime = true;
                _guideDatePicker.Value = guideDate;

                RefreshEpg(true);
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor.Current = Cursors.Default;
                _inLoad = false;
            }
        }
Esempio n. 2
0
        protected override void OnPageLoad()
        {
            if (PluginMain.EnsureConnection()
                && _model == null)
            {
                _model = new GuideModel();
                _controller = new GuideController(_model);
                _controller.Initialize(_channelType, 3, Utility.GetLocalizedText(TextId.AllChannels));
            }

            if (PluginMain.Navigator.CurrentGroup != null
                && PluginMain.Navigator.CurrentGroup.ChannelType == _channelType)
            {
                _controller.SetChannelGroup(PluginMain.Navigator.CurrentGroup.ChannelGroupId);
            }

            base.OnPageLoad();
        }