void InputDataDetector_FormClosing(object sender, FormClosingEventArgs e) { ThreadPool.QueueUserWorkItem((c) => { _inputPinWatcher.Stop(); _inputPinWatcher = null; }); }
public InputDataDetector(string inputPinName, string inputPinCfgData) : base() { InitializeComponent(); SetTitle("TXT_DETECT"); _inputPinWatcher = new InputPinProbe(inputPinName, inputPinCfgData); _inputPinWatcher.InputPinData += new InputPinProbeHandler(_inputPinWatcher_InputPinData); this.FormClosing += new FormClosingEventHandler(InputDataDetector_FormClosing); }