public void SetupDialog() { // consider only showing the setup dialog if not connected // or call a different dialog if connected if (IsConnected) { System.Windows.Forms.MessageBox.Show("Already connected, just press OK"); } using (SetupDialogForm F = new SetupDialogForm()) { var result = F.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { WriteProfile(); // Persist device configuration values to the ASCOM Profile store } } }
public void SetupDialog() { SetupDialogForm F = new SetupDialogForm(); F.ShowDialog(); }
// // PUBLIC COM INTERFACE IFocuserV2 IMPLEMENTATION // #region Common properties and methods. /// <summary> /// Displays the Setup Dialog form. /// If the user clicks the OK button to dismiss the form, then /// the new settings are saved, otherwise the old values are reloaded. /// THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED! /// </summary> public void SetupDialog() { // consider only showing the setup dialog if not connected // or call a different dialog if connected if (IsConnected) System.Windows.Forms.MessageBox.Show("Already connected, just press OK"); using (SetupDialogForm F = new SetupDialogForm(this) { // saveParameters = saveParametersImpl;//new Func<int,bool>(); saveParameters = saveParametersImpl }) { var result = F.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { WriteProfile(); // Persist device configuration values to the ASCOM Profile store } } }
public void SetupDialog() { SetupDialogForm F = new SetupDialogForm(); F.ShowDialog(); }
public void SetupDialogFormConstructorTest() { Dome parent = this; //null; // TODO: Initialize to an appropriate value SetupDialogForm target = new SetupDialogForm(parent); //Assert.Inconclusive("TODO: Implement code to verify target");* try { var result = target.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { Assert.IsTrue(true, "Test SetupDialogForm PASS"); } } catch (NullReferenceException ex) { Assert.IsTrue(true, "Test SetupDialogForm OK press Cancel"); } catch (Exception) { Assert.Fail(); } }
// // PUBLIC COM INTERFACE IDomeV2 IMPLEMENTATION // #region Common properties and methods. /// <summary> /// Displays the Setup Dialog form. /// If the user clicks the OK button to dismiss the form, then /// the new settings are saved, otherwise the old values are reloaded. /// THIS IS THE ONLY PLACE WHERE SHOWING USER INTERFACE IS ALLOWED! /// </summary> public void SetupDialog() { // consider only showing the setup dialog if not connected // or call a different dialog if connected if (IsConnected) System.Windows.Forms.MessageBox.Show("Already connected, just press OK"); //_telescope = new ASCOM_Telescope(); using (SetupDialogForm F = new SetupDialogForm(this))//_telescope)) { var result = F.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { WriteProfile(); // Persist device configuration values to the ASCOM Profile store } else { // This is a workaroundto implement the cancel option return from the dialog throw new NullReferenceException("SetupDialog Cancel"); } } }