Example #1
0
        public static void ContextCreateNewSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.CreateNewScheduleEventArgs e)
        {
            EditSchedulePanel editPanel = new EditSchedulePanel();

            editPanel.Schedule = e.Schedule;
            editPanel.OpenPanel(panel);
        }
Example #2
0
 private void CloseAndRemovePanel(ContentPanel contentPanel)
 {
     contentPanel.Visible = false;
     contentPanel.OnClosed();
     _contentContainer.Controls.Remove(contentPanel);
     contentPanel.Dispose();
 }
Example #3
0
 public static bool ContextAddRemoveProgramHistory(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.AddRemoveProgramHistoryEventArgs e)
 {
     try
     {
         if (e.AddToHistory)
         {
             if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to add this recording to its schedule's" + Environment.NewLine + "history of previously recorded programs?", "Add To History", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
             {
                 Proxies.ControlService.AddToPreviouslyRecordedHistory(e.UpcomingProgram);
                 return(true);
             }
         }
         else
         {
             if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to remove this recording from its schedule's" + Environment.NewLine + "history of previously recorded programs?", "Add To History", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
             {
                 Proxies.ControlService.RemoveFromPreviouslyRecordedHistory(e.UpcomingProgram);
                 return(true);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }
Example #4
0
        private void _cancelMenuItemLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            ContentPanel activePanel = this.ActiveContentPanel;

            if (activePanel != null)
            {
                activePanel.OnCancel();
            }
        }
Example #5
0
 public void OpenContentPanel(ContentPanel contentPanel)
 {
     foreach (Control control in _contentContainer.Controls)
     {
         control.Visible = false;
     }
     contentPanel.Dock = DockStyle.Fill;
     _contentContainer.Controls.Add(contentPanel);
     this.Text = _formTitle + " - " + contentPanel.Title;
 }
Example #6
0
 public void CloseContentPanel(ContentPanel contentPanel, ContentPanel activatePanel)
 {
     this.Text = _formTitle;
     if (activatePanel != null)
     {
         this.Text             = _formTitle + " - " + activatePanel.Title;
         activatePanel.Visible = true;
     }
     CloseAndRemovePanel(contentPanel);
 }
Example #7
0
 public static bool ContextSetProgramPriority(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.SetProgramPriorityEventArgs e)
 {
     try
     {
         Proxies.SchedulerService.SetUpcomingProgramPriority(e.UpcomingProgramId, e.StartTime, e.Priority);
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }
Example #8
0
 public static void ContextEditSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.EditScheduleEventArgs e)
 {
     try
     {
         EditSchedulePanel editPanel = new EditSchedulePanel();
         editPanel.Schedule = Proxies.SchedulerService.GetScheduleById(e.ScheduleId).Result;
         editPanel.OpenPanel(panel);
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #9
0
 public static bool ContextDeleteSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.EditScheduleEventArgs e)
 {
     try
     {
         if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to delete this recording's schedule?", "Delete Schedule", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
         {
             Proxies.SchedulerService.DeleteSchedule(e.ScheduleId);
             return(true);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }
Example #10
0
 public void CloseAllContentPanels()
 {
     while (_contentContainer.Controls.Count > 0)
     {
         Control      control      = _contentContainer.Controls[0];
         ContentPanel contentPanel = control as ContentPanel;
         if (contentPanel != null)
         {
             CloseAndRemovePanel(contentPanel);
         }
         else
         {
             _contentContainer.Controls.RemoveAt(0);
             control.Dispose();
         }
     }
 }
Example #11
0
 public static bool ContextCancelProgram(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.CancelProgramEventArgs e)
 {
     try
     {
         if (e.Cancel)
         {
             Proxies.SchedulerService.CancelUpcomingProgram(e.ScheduleId, e.GuideProgramId, e.ChannelId, e.StartTime);
         }
         else
         {
             Proxies.SchedulerService.UncancelUpcomingProgram(e.ScheduleId, e.GuideProgramId, e.ChannelId, e.StartTime);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return(false);
 }
Example #12
0
 public virtual void OnChildClosed(ContentPanel childPanel)
 {
 }
Example #13
0
 private void CloseAndRemovePanel(ContentPanel contentPanel)
 {
     contentPanel.Visible = false;
     contentPanel.OnClosed();
     _contentContainer.Controls.Remove(contentPanel);
     contentPanel.Dispose();
 }
Example #14
0
 public virtual void OnChildClosed(ContentPanel childPanel)
 {
 }
Example #15
0
 public static bool ContextSetProgramPrePostRecord(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.SetProgramPrePostRecordEventArgs e)
 {
     try
     {
         if (e.IsPreRecord)
         {
             Proxies.SchedulerService.SetUpcomingProgramPreRecord(e.UpcomingProgramId, e.StartTime, e.Seconds);
         }
         else
         {
             Proxies.SchedulerService.SetUpcomingProgramPostRecord(e.UpcomingProgramId, e.StartTime, e.Seconds);
         }
         return true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return false;
 }
Example #16
0
 public static bool ContextAddRemoveProgramHistory(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.AddRemoveProgramHistoryEventArgs e)
 {
     try
     {
         if (e.AddToHistory)
         {
             if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to add this recording to its schedule's" + Environment.NewLine + "history of previously recorded programs?", "Add To History", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
             {
                 Proxies.ControlService.AddToPreviouslyRecordedHistory(e.UpcomingProgram);
                 return true;
             }
         }
         else
         {
             if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to remove this recording from its schedule's" + Environment.NewLine + "history of previously recorded programs?", "Add To History", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
             {
                 Proxies.ControlService.RemoveFromPreviouslyRecordedHistory(e.UpcomingProgram);
                 return true;
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return false;
 }
Example #17
0
 public static bool ContextCancelProgram(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.CancelProgramEventArgs e)
 {
     try
     {
         if (e.Cancel)
         {
             Proxies.SchedulerService.CancelUpcomingProgram(e.ScheduleId, e.GuideProgramId, e.ChannelId, e.StartTime);
         }
         else
         {
             Proxies.SchedulerService.UncancelUpcomingProgram(e.ScheduleId, e.GuideProgramId, e.ChannelId, e.StartTime);
         }
         return true;
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return false;
 }
Example #18
0
 public static bool ContextDeleteSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.EditScheduleEventArgs e)
 {
     try
     {
         if (DialogResult.Yes == MessageBox.Show(panel, "Are you sure you want to delete this recording's schedule?", "Delete Schedule", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
         {
             Proxies.SchedulerService.DeleteSchedule(e.ScheduleId);
             return true;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     return false;
 }
Example #19
0
 public static void ContextEditSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.EditScheduleEventArgs e)
 {
     try
     {
         EditSchedulePanel editPanel = new EditSchedulePanel();
         editPanel.Schedule = Proxies.SchedulerService.GetScheduleById(e.ScheduleId).Result;
         editPanel.OpenPanel(panel);
     }
     catch (Exception ex)
     {
         MessageBox.Show(panel, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #20
0
 public static void ContextCreateNewSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.CreateNewScheduleEventArgs e)
 {
     EditSchedulePanel editPanel = new EditSchedulePanel();
     editPanel.Schedule = e.Schedule;
     editPanel.OpenPanel(panel);
 }
Example #21
0
 public void CloseContentPanel(ContentPanel contentPanel, ContentPanel activatePanel)
 {
     this.Text = _formTitle;
     if (activatePanel != null)
     {
         this.Text = _formTitle + " - " + activatePanel.Title;
         activatePanel.Visible = true;
     }
     CloseAndRemovePanel(contentPanel);
 }
Example #22
0
 public void OpenPanel(ContentPanel ownerPanel)
 {
     _ownerPanel = ownerPanel;
     _ownerPanel.MainForm.OpenContentPanel(this);
 }
Example #23
0
 public void OpenPanel(ContentPanel ownerPanel)
 {
     _ownerPanel = ownerPanel;
     _ownerPanel.MainForm.OpenContentPanel(this);
 }
Example #24
0
 public void OpenContentPanel(ContentPanel contentPanel)
 {
     foreach (Control control in _contentContainer.Controls)
     {
         control.Visible = false;
     }
     contentPanel.Dock = DockStyle.Fill;
     _contentContainer.Controls.Add(contentPanel);
     this.Text = _formTitle + " - " + contentPanel.Title;
 }