Esempio n. 1
0
 private void clearSwitch_Click(object sender, EventArgs e)
 {
     settings.Set("switchDriverId", String.Empty);
     switchDriverName.Text = DeviceName("Switch", String.Empty);
     SharedResources.FreeMount();
     LoadSwitches();
 }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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();
                }
            }
        }