Пример #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;
            }
        }
        public void RefreshEpg(GuideModel model)
        {
            _model = model;

            _channelCells.Clear();

            int top = 0;
            foreach (Channel channel in _model.Channels)
            {
                top = CreateChannelCell(channel, top);
            }
            this.Height = top;

            this.Refresh();
        }
Пример #3
0
 public GuideController(GuideModel model)
 {
     _model = model;
 }
Пример #4
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();
        }
        public void RefreshEpg(GuideModel model)
        {
            _model = model;

            _guideProgramCells.Clear();

            int top = 0;
            foreach (Channel channel in _model.Channels)
            {
                top = CreateEpgChannelCells(channel, top);
            }
            this.Width = (int)(5760 * _widthFactor);
            this.Height = top;

            this.Refresh();
        }
Пример #6
0
 public void RefreshEpg(GuideModel model)
 {
     _epgProgramsGridControl.RefreshEpg(model);
 }
Пример #7
0
 public void RefreshEpg(GuideModel model)
 {
     _model = model;
     _epgChannelsControl.RefreshEpg(model);
     _epgProgramsControl.RefreshEpg(model);
     SetTimeIndicator();
 }
Пример #8
0
 public static DateTime GetEpgStartTime(GuideModel model)
 {
     return model.GuideDateTime.Date.AddHours(EpgHoursOffset);
 }
Пример #9
0
 public static DateTime GetEpgEndTime(GuideModel model)
 {
     return model.GuideDateTime.Date.AddDays(1).AddHours(EpgHoursOffset);
 }
Пример #10
0
 public void RefreshEpg(GuideModel model)
 {
     _epgChannelsGridControl.RefreshEpg(model);
 }
Пример #11
0
 public GuideController(GuideModel model)
 {
     _model = model;
 }