public WizardForm(MainForm mainForm) { this.mainForm = mainForm; InitializeComponent(); // wizardPageChannelParameters this.comboBoxTunerType.Items.AddRange(new TunerTypeEx[] { new TunerTypeEx(TunerType.DVBT), new TunerTypeEx(TunerType.DVBC), new TunerTypeEx(TunerType.DVBS), new TunerTypeEx(TunerType.Analogic) }); this.comboBoxTunerType.SelectedIndex = 0; // wizardPageScanner this.listViewScanResult.SmallImageList = MainForm.imageListLogoTV; // wizardPageChannelNumber this.listViewChannelNumbering.SmallImageList = MainForm.imageListLogoTV; }
public void OnMainAppStarted(MainForm form) { foreach (IPlugin plugin in this.plugins) { try { plugin.OnMainAppStarted(form); } catch (Exception ex) { MessageBox.Show(string.Format(Properties.Resources.PluginException, plugin.Name, ex.ToString())); } } }
// Contructor public MainForm() { mainForm = this; InitializeComponent(); // Disabled the screensaver SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, ref this.screenSaverWasEnabled, 0); if (this.screenSaverWasEnabled) SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, false, IntPtr.Zero, 0); // Disabled power saving this.powerSavingPreviousState = SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_CONTINUOUS); // Miscellaneous initialization ToolStripManager.LoadSettings(this, RegistryBaseKey); this.dockPanel.SuspendLayout(); this.panelChannel = new PanelChannel(); this.panelChannelProperties = new PanelChannelProperties(); this.panelEPG = new PanelEPG(); this.panelInfos = new PanelInfos(); this.panelMediaTuning = new PanelMediaTuning(); this.panelSettings = new PanelSettings(); this.panelTimeLine = new PanelTimeLine(); this.panelTimeLine.ShowHint = DockState.DockBottom; this.panelVideo = new PanelVideo(); this.videoControl = new VideoControl(); this.videoControl.BackColor = System.Drawing.Color.Black; this.videoControl.ContextMenuStrip = this.contextMenuStripPanelVideo; this.videoControl.Name = "videoControl"; this.videoControl.Dock = DockStyle.Fill; this.videoControl.DoubleClick += new System.EventHandler(this.videoControl_DoubleClick); this.videoControl.Resize += new System.EventHandler(this.videoControl_Resize); this.videoControl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.videoControl_KeyDown); this.videoControl.MouseWheel += new MouseEventHandler(videoControl_MouseWheel); this.panelVideo.Controls.Add(this.videoControl); this.deserializeDockContent = new DeserializeDockContent(GetContentFromPersistString); try { this.dockPanel.LoadFromXml(FileUtils.WorkingDirectory + "\\" + AssemblyName + ".Settings.UI.xml", deserializeDockContent); } catch (FileNotFoundException) { this.dockPanel.DockBottomPortion = 58; this.dockPanel.DockTopPortion = 58; this.panelChannelProperties.Show(this.dockPanel, DockState.DockRightAutoHide); this.panelSettings.Show(this.dockPanel, DockState.DockRightAutoHide); this.panelChannel.Show(this.dockPanel, DockState.DockLeft); this.panelMediaTuning.Show(this.panelChannel.Pane, DockAlignment.Bottom, 0.3); this.panelTimeLine.Show(this.dockPanel, DockState.DockBottom); } this.panelVideo.Show(this.dockPanel); this.videoForm.FormClosing += new FormClosingEventHandler(videoForm_FormClosing); // Load the default channels FileStream fileStream = null; try { fileStream = new FileStream(FileUtils.WorkingDirectory + "\\" + AssemblyName + ".Channels.xml", FileMode.Open); this.panelChannel.LoadChannels(fileStream); } catch { firstLaunch = true; } finally { if (fileStream != null) fileStream.Close(); } // Settings this.panelMediaTuning.trackBarVolume.Value = MainForm.Settings.Volume; this.panelMediaTuning.trackBarBalance.Value = MainForm.Settings.Balance; this.editToolStripMenuItem.DropDown = this.contextMenuStripPanelVideo; this.aspecRatio169toolStripMenuItem.Checked = Settings.UseVideo169Mode; ChangeSetting("UseVideo169Mode"); this.toolStripButtonTimeShifting.Checked = Settings.TimeShiftingActivated; ChangeSetting("TimeShiftingActivated"); ChangeSetting("UseWPF"); ChangeSetting("VideoBackgroundColor"); ChangeSetting("UseWinLIRC"); this.dockPanel.ResumeLayout(); beforeLaunchWindowState = WindowState; switch (Settings.StartVideoMode) { case VideoMode.TV: ExecuteCommand(CommandName.VideoModeTV); //WindowState = FormWindowState.Minimized; break; case VideoMode.Fullscreen: ExecuteCommand(CommandName.VideoModeFullscreen); //WindowState = FormWindowState.Minimized; break; } }