public override bool Stop() { if (_device != null) { _device.Dispose(); } return(true); }
private void Disconnect() { _connected = false; connectBtn.Text = "Connect"; connectBtn.BackColor = _defaultColor; connectBtn.UseVisualStyleBackColor = true; if (_device != null) { _device.Dispose(); _device = null; } alarmsDataGrid.Rows.Clear(); getStateBtn.Enabled = false; downloadConfigBtn.Enabled = false; ResetPorts(); this.Text = "DCController - Disconnected"; }