public static void ContextCreateNewSchedule(ContentPanel panel, ArgusTV.WinForms.Controls.ProgramContextMenuStrip.CreateNewScheduleEventArgs e) { EditSchedulePanel editPanel = new EditSchedulePanel(); editPanel.Schedule = e.Schedule; editPanel.OpenPanel(panel); }
private void CloseAndRemovePanel(ContentPanel contentPanel) { contentPanel.Visible = false; contentPanel.OnClosed(); _contentContainer.Controls.Remove(contentPanel); contentPanel.Dispose(); }
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); }
private void _cancelMenuItemLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { ContentPanel activePanel = this.ActiveContentPanel; if (activePanel != null) { activePanel.OnCancel(); } }
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; }
public void CloseContentPanel(ContentPanel contentPanel, ContentPanel activatePanel) { this.Text = _formTitle; if (activatePanel != null) { this.Text = _formTitle + " - " + activatePanel.Title; activatePanel.Visible = true; } CloseAndRemovePanel(contentPanel); }
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); }
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); } }
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); }
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(); } } }
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); }
public virtual void OnChildClosed(ContentPanel childPanel) { }
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; }
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; }
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; }
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; }
public void OpenPanel(ContentPanel ownerPanel) { _ownerPanel = ownerPanel; _ownerPanel.MainForm.OpenContentPanel(this); }