public void SetupDialog() { // show camera settings form if (IsConnected) return; using (SetupDialogForm F = new SetupDialogForm()) { var result = F.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { // Persist device configuration values to the ASCOM Profile store WriteProfile(); } } }