private void chooseSwitch_Click(object sender, EventArgs e) { string switchDriverId = settings.Get("switchDriverId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Switch"; string val = chooser.Choose(switchDriverId); if (!String.IsNullOrEmpty(val) && val != switchDriverId) { settings.Set("switchDriverId", val); switchDriverName.Text = DeviceName("Switch", val); SharedResources.FreeMount(); } } LoadSwitches(); }
private void chooseCam_Click(object sender, EventArgs e) { string camId = settings.Get("cameraId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Camera"; string val = chooser.Choose(camId); if (!String.IsNullOrEmpty(val) && val != camId) { if (val == SharedResources.CamDriverId) { return; // reject choice of this driver! } settings.Set("cameraId", val); camName.Text = DeviceName("Camera", val); SharedResources.FreeCamera(); } } }
private void chooseMount_Click(object sender, EventArgs e) { string scopeId = settings.Get("scopeId"); using (ASCOM.Utilities.Chooser chooser = new Utilities.Chooser()) { chooser.DeviceType = "Telescope"; string val = chooser.Choose(scopeId); if (!String.IsNullOrEmpty(val) && val != scopeId) { if (val == SharedResources.ScopeDriverId) { return; // reject choice of this driver! } settings.Set("scopeId", val); mountName.Text = DeviceName("Telescope", val); SharedResources.FreeMount(); } } }