Inheritance: XenAdmin.Dialogs.XenDialogBase
Example #1
0
        private bool HideAndPromptForNewPassword(IXenConnection xenConnection, string oldPassword)
        {
            bool result = false;

            Program.Invoke(Program.MainWindow, delegate()
            {
                bool wasVisible = Visible;
                if (wasVisible)
                {
                    Hide();
                }

                // show an altered version of the add server dialog with the hostname greyed out
                AddServerDialog dialog = new AddServerDialog(xenConnection, true);
                result = dialog.ShowDialog(getOwnerForm()) == DialogResult.OK;

                if (result && wasVisible)
                {
                    Show(getOwnerForm());
                }
                if (!result)
                {
                    if (_connection != null)
                    {
                        XenConnectionUI.connectionDialogs.Remove(_connection);
                    }
                }
            });
            return(result);
        }
Example #2
0
 public static bool PromptForNewPassword(IXenConnection connection, string oldPassword)
 {
     bool result = false;
     Program.Invoke(Program.MainWindow, delegate()
                                            {
                                                // show an altered version of the add server dialog with the hostname greyed out
                                                AddServerDialog dialog = new AddServerDialog(connection, true);
                                                result = dialog.ShowDialog(Program.MainWindow) == DialogResult.OK;
                                            });
     return result;
 }
        private bool HideAndPromptForNewPassword(IXenConnection xenConnection, string oldPassword)
        {
            bool result = false;

            Program.Invoke(Program.MainWindow, () =>
            {
                bool wasVisible = Visible;
                if (wasVisible)
                {
                    Hide();
                }

                // show an altered version of the add server dialog with the hostname greyed out
                using (var dialog = new AddServerDialog(xenConnection, true))
                    result = dialog.ShowDialog(GetOwnerForm()) == DialogResult.OK;

                if (result && wasVisible)
                {
                    Show(GetOwnerForm());
                }
            });
            return(result);
        }
Example #4
0
 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     _dialog = new AddServerDialog(null, false);
     _dialog.CachePopulated += dialog_CachePopulated;
     _dialog.Show(Parent);
 }
        private bool HideAndPromptForNewPassword(IXenConnection xenConnection, string oldPassword)
        {
            bool result = false;
            Program.Invoke(Program.MainWindow, delegate()
                                                   {
                                                       bool wasVisible = Visible;
                                                       if (wasVisible)
                                                       {
                                                           Hide();
                                                       }

                                                       // show an altered version of the add server dialog with the hostname greyed out
                                                       AddServerDialog dialog = new AddServerDialog(xenConnection, true);
                                                       result = dialog.ShowDialog(getOwnerForm()) == DialogResult.OK;

                                                       if (result && wasVisible)
                                                       {
                                                           Show(getOwnerForm());
                                                       }
                                                   });
            return result;
        }
Example #6
0
 public void Start()
 {
     AddServerDialog dialog = new AddServerDialog(_connection, false);
     dialog.FormClosing += formClosing;
     dialog.Show(_parentForm);
 }