protected override void OnClosing(CancelEventArgs e) { if (Tuner != null) { Tuner.CloseTuner(); Tuner = null; } SetConnected(false); base.OnClosing(e); }
private void btnConnect_Click(object sender, EventArgs e) { if (Tuner != null) { SetConnected(false); Tuner.CloseTuner(); Tuner = null; } else { Tuner = new AR5000(true); if (!Tuner.OpenTuner()) { SetConnected(false); Tuner = null; return; } SetConnected(true); } }