private void ChooseButton_Click(object sender, EventArgs e) { ASCOM.Utilities.Chooser _chooser = new Chooser(); _chooser.DeviceType = "Focuser"; _progID = _chooser.Choose(_progID); _chooser.Dispose(); ChosenFocuser.Text = _progID; //_profile.WriteValue(_appID, "ChosenFocuser", _progID); if (_progID == "") return; if (_progID == "") ConnectButton.Enabled = false; else ConnectButton.Enabled = true; }
public void Reset() { if (welcomeSound != null) { welcomeSound.Stop(); } //components.Remove(profil); profil = null; components.Remove(chooser); if (chooser != null) { chooser.Dispose(); } chooser = null; components.Remove(intro); if (intro != null) { intro.Dispose(); } intro = null; components.Remove(credits); if (credits != null) { credits.Dispose(); } credits = null; components.Remove(menu); menu = null; components.Remove(level); level = null; components.Remove(hud); hud = null; components.Remove(console); console = null; components.Clear(); if (game.World != null) { //components.Remove(game.World); game.World.Dispose(); game.World = null; } /* * if (score != null) * { * score.Reset(); * } * score = null;*/ Material.ClearSharedPool(); }
private void ChooseButton_Click(object sender, EventArgs e) { ASCOM.Utilities.Chooser _chooser = new Chooser(); _chooser.DeviceType = "Focuser"; _progID = _chooser.Choose(_progID); _chooser.Dispose(); ChosenFocuser.Text = _progID; //_profile.WriteValue(_appID, "ChosenFocuser", _progID); if (_progID == "") { return; } if (_progID == "") { ConnectButton.Enabled = false; } else { ConnectButton.Enabled = true; } }
/// <summary> /// Event handler for Choose button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnChoose_Click(System.Object sender, System.EventArgs e) { Chooser chooser = new Chooser(); string NewDevice = null; CurrentDeviceType = cmbDeviceType.SelectedItem.ToString(); chooser.DeviceType = CurrentDeviceType; if (string.IsNullOrEmpty(CurrentDevice)) { CurrentDevice = DefaultDevices[CurrentDeviceType.ToUpperInvariant()]; txtDevice.Text = DefaultDevices[CurrentDeviceType.ToUpperInvariant()]; } NewDevice = chooser.Choose(CurrentDevice); if (!string.IsNullOrEmpty(NewDevice)) { CurrentDevice = NewDevice; } txtDevice.Text = CurrentDevice; chooser.Dispose(); }
protected override void EndProcessing() { //base.EndProcessing(); m_chooser.Dispose(); m_chooser = null; }