/// <summary> /// Starts monitoring in five seconds (not immediate to allow chance /// to cancel) /// </summary> /// <param name="mode">Specifies the scanning mode</param> /// <param name="win">The window of interest (when needed)</param> /// <param name="title">The comparison string (when needed)</param> public void StartMonitoring(WindowScannerMode mode, SystemWindow win, string title) { _mode = mode; _win = win; // Changes is the same as DOES_NOT_EQUAL, except it compares // to the current title value. if (_mode == WindowScannerMode.TITLE_CHANGES) { _title = win.Title; } else { _title = title; } timer.Change(5000, 1000); }
/// <summary> /// Event handler for conditionComboBox SelectedValueChanged event. Disabled/enables /// the text box and shows/hides the "Ignored" label. /// </summary> private void conditionComboBox_SelectedValueChanged(object sender, EventArgs e) { if (conditionComboBox.SelectedItem != null) { selectedMode = (WindowScannerMode)conditionComboBox.SelectedItem; if (selectedMode == WindowScannerMode.WINDOW_DISAPPEARS || selectedMode == WindowScannerMode.TITLE_CHANGES) { ignoredLabel.Visible = true; titleTextBox.Enabled = false; } else { ignoredLabel.Visible = false; titleTextBox.Enabled = true; } } }