/// <summary> /// Start the session, if possible. /// </summary> private void HandleSessionStart() { // Check if the KCD has already sent us the end session event. if (SessionIDTree.ContainsKey(SessionID)) { HandleSessionTrouble(new Exception("the KCD closed the connection unexpectedly")); return; } // Clear the session ID tree. SessionIDTree.Clear(); // Show the overlay window. Overlay = new RunningOverlay(); Overlay.Relink(this); // Configure the inactivity monitor to timeout about 10 minutes. InactivityMonitor = MonitorCreator.CreateInstance(MonitorType.GlobalHookMonitor); InactivityMonitor.MonitorKeyboardEvents = true; InactivityMonitor.MonitorMouseEvents = true; InactivityMonitor.Interval = 600000; InactivityMonitor.Elapsed += delegate(Object sender, ElapsedEventArgs args) { KBase.ExecInUI(OnInactivity); }; InactivityMonitor.Enabled = true; // Start the session. Status = VncSessionStatus.Started; // Notify listeners. PostLocalVncSessionEvent(true, null); Kws.OnStateChange(WmStateChange.Transient); }
public void ProductMonitorTest() { var message = "Creator: the same creator's code has just worked with {Result of Monitor class}"; var monitor = new MonitorCreator(); var result = monitor.SomeOperation(); message.Equals(result).Should().BeTrue(); }