상속: XenAdmin.Dialogs.XenDialogBase
예제 #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);
        }
예제 #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;
 }
예제 #3
0
        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);
        }
예제 #4
0
 protected override void ExecuteCore(SelectedItemCollection selection)
 {
     _dialog = new AddServerDialog(null, false);
     _dialog.CachePopulated += dialog_CachePopulated;
     _dialog.Show(Parent);
 }
예제 #5
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());
                                                       }
                                                   });
            return result;
        }
예제 #6
0
 public void Start()
 {
     AddServerDialog dialog = new AddServerDialog(_connection, false);
     dialog.FormClosing += formClosing;
     dialog.Show(_parentForm);
 }