static void Main(string[] args) { // Uncomment the code that's required #if UseChooser // choose the device string id = ASCOM.DriverAccess.TEMPLATEDEVICECLASS.Choose(""); if (string.IsNullOrEmpty(id)) { return; } // create this device ASCOM.DriverAccess.TEMPLATEDEVICECLASS device = new ASCOM.DriverAccess.TEMPLATEDEVICECLASS(id); #else // this can be replaced by this code, it avoids the chooser and creates the driver class directly. ASCOM.DriverAccess.TEMPLATEDEVICECLASS device = new ASCOM.DriverAccess.TEMPLATEDEVICECLASS("ASCOM.TEMPLATEDEVICENAME.TEMPLATEDEVICECLASS"); #endif // now run some tests, adding code to your driver so that the tests will pass. // these first tests are common to all drivers. Console.WriteLine("name " + device.Name); Console.WriteLine("description " + device.Description); Console.WriteLine("DriverInfo " + device.DriverInfo); Console.WriteLine("driverVersion " + device.DriverVersion); // TODO add more code to test the driver. device.Connected = true; device.Connected = false; Console.WriteLine("Press Enter to finish"); Console.ReadLine(); }
private void buttonConnect_Click(object sender, EventArgs e) { if (IsConnected) { driver.Connected = false; } else { driver = new ASCOM.DriverAccess.TEMPLATEDEVICECLASS(Properties.Settings.Default.DriverId); driver.Connected = true; } SetUIState(); }