/// <summary> /// Toggles whether we should show only pol.exe processes or /// all processes. /// </summary> private void ChangeFilter() { // Toggle the process name. The process watcher knows that // the empty string means locate all processes. if (ProcessName.Equals(ClientName)) { ProcessName = string.Empty; ToggleButtonHeader = "POL Only"; } else { ProcessName = ClientName; ToggleButtonHeader = "Show All"; } // Dispose of the old watcher. _processWatcher.Stop(); // Clear all previously found processes. Sessions.Clear(); // Start up the new watcher. _processWatcher = new ProcessWatcher(ProcessName); _processWatcher.Entry += SessionEntry; _processWatcher.Exit += SessionExit; _processWatcher.Start(); }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (pWatcher != null) { pWatcher.Stop(); } }
public void Config(BeSafeConfig config, PipeServer pipeServer, bool stoppingService) { bool stateResult = (((config?.ComponentsState.ProcessWatcher == true) && (stoppingService == false)) ? _processWatcher.Start() : _processWatcher.Stop()); }
/// <summary> /// Stops the Hearthstone log and process monitoring. /// </summary> public async Task Stop() { await _procWatcher.Stop(); await LogReader.Stop(); Game.Reset(); _running = false; }
private void MetroWindow_Closed(object sender, EventArgs e) { Keymapper.Stop(); ProcessWatcher.Stop(); HapticManager.Stop(); var aC = ControllerManager.GetActiveController(); aC?.SetLightbar(0, 0, 0); aC?.Stop(); ControllerManager.Stop(); _notifyIcon.Visible = false; _notifyIcon.Dispose(); WindowClosing?.Invoke(); }
public void Stop_DoesNotThrow() { Utils.MethodStart(); foreach (var name in EnumValues.GetString()) { foreach (var affinity in EnumValues.GetLong()) { foreach (var user in EnumValues.GetString()) { Assert.DoesNotThrow(() => { var procConfig = new ProcessConfig(name, affinity, user); var processWatcher = new ProcessWatcher(new List <ProcessConfig>() { procConfig }); processWatcher.Start(); processWatcher.Stop(); }); TestContext.WriteLine($@"Assert.DoesNotThrow(() => new ProcConfig({name}, {affinity}, {user}))"); Assert.DoesNotThrowAsync(async() => await Task.Run(() => { var procConfig = new ProcessConfig(name, affinity, user); var processWatcher = new ProcessWatcher(new List <ProcessConfig>() { procConfig }); processWatcher.Start(); processWatcher.Stop(); })); TestContext.WriteLine($@"Assert.DoesNotThrowAsync(async () => new ProcConfig({name}, {affinity}, {user}))"); } } } Utils.MethodComplete(); }
/// <inheritdoc /> protected override bool OnStopRuntimeWatching() { _runtimeWatcher.ProcessCreated -= OnRuntimeProcessCreated; _runtimeWatcher.ProcessDeleted -= OnRuntimeProcessDeleted; return(_runtimeWatcher.Stop()); }
public void StopRemovesRegisterEvent() { _processWatcher.Stop(); _mockProcess.ReceivedWithAnyArgs().RemoveRegisteredEvent(TestEvent); }
public void Stop() { _tracking = false; _watcher.Stop(); }