public MainForm() { InitializeComponent(); // we want to receive key event KeyPreview = true; this.WindowState = FormWindowState.Minimized; AutoSize = true; AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; pnlMore.Visible = false; InitDeviceList(); mDisplay = new Display(); mDisplay.DSEngine.Notified += new Action <NotifyEventArgs>(DSEngine_Notified); mDisplay.DSEngine.PlayerStarted += new Action <EventArgs>(DSEngine_PlayerStarted); // Get POST Ids string[] postIds = new string[_settings.UIPostList.Count]; _settings.UIPostList.CopyTo(postIds, 0); // Populate PostPropertyCollection foreach (string id in postIds) { _postProperties.Add(id, new PostProperty(id)); } // Populate cbPost cbPost.Items.Clear(); cbPost.Items.AddRange(postIds); // Populate cbSelectPost cbSelectPost.Items.Clear(); cbSelectPost.Items.AddRange(postIds); // Check Screen Count Screen[] screens = Screen.AllScreens; if (screens.Length > 1) { btnSwitchDisplay.Enabled = true; } RestoreSettings(); if (_settings.PlayVideoAtStartup) { OnOpenCloseVideo(this, EventArgs.Empty); } // start tcp client StartClient(); //mDisplay.TopMost = true; mDisplay.Focus(); mDisplay.Show(); startupComplete = true; }
public OptionForm() { InitializeComponent(); // Get POST Ids string[] postIds = new string[Properties.Settings.Default.UIPostList.Count]; Properties.Settings.Default.UIPostList.CopyTo(postIds, 0); // Populate PostPropertyCollection foreach (string id in postIds) { postProperties.Add(id, new PostProperty(id)); } // Populate cbPost cbPost.Items.Clear(); cbPost.Items.AddRange(postIds); // Populate cbSelectPost cbSelectPost.Items.Clear(); cbSelectPost.Items.AddRange(postIds); RestoreSettings(); }