/// <summary> /// Event when the BackgroundWorker has completed i.e. frmSwitchUI has been closed /// </summary> private void bgwShowSwitchUI_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { //If a VNC session is still running, bring back the SwitchUI if (EventLogManagement.IsVNCConnected()) { ShowSwitchUI(false); } }
/// <summary> /// Constructor for frmTray /// </summary> /// <param name="showui">Whether frmSwitchUI should be shown when frmTray starts</param> public frmTray(bool showui) { InitializeComponent(); //Reduce form size to 0 i.e. hidden this.Size = new System.Drawing.Size(0, 0); //Check if a VNC session is already in progress, show frmSwitchUI if so if (EventLogManagement.IsVNCConnected()) { ShowSwitchUI(false); } //If specified, show frmSwitchUI now if (showui) { ShowSwitchUI(true); } //Tidy up property for SetVisibleCore override _canShow = true; this.Show(); }