/// <summary> /// Event to be fired when an Event Log entry for VNC Server has been written /// </summary> private void eventLog1_EntryWritten(object sender, System.Diagnostics.EntryWrittenEventArgs e) { if (EventLogManagement.MonitorDisconnects(e)) { allowclose = true; this.Close(); } }
/// <summary> /// Event fired when Event Log entry written by VNC Server /// </summary> private void evtlgAuthenticated_EntryWritten(object sender, System.Diagnostics.EntryWrittenEventArgs e) { //If log entry is a VNC authentication, show frmSwitchUI and blcoking closure - collapsable only if (EventLogManagement.MonitorAuths(e)) { ShowSwitchUI(false); } }
/// <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(); }