internal void ShowConfigurationDialog() { //if (Program.MainWindow.Confirms(this.noSetVM.Connection, Messages.BACKUP_CHECK_ERROR_MESSAGE, new object[] { (this.noSetVM as VM).name_label })) if (DialogResult.OK == MessageBox.Show(this, string.Format(Messages.BACKUP_CHECK_ERROR_MESSAGE, new object[] { (this.noSetVM as VM).name_label }), Messages.MESSAGEBOX_CONFIRM, MessageBoxButtons.OKCancel, MessageBoxIcon.Question)) { BackupConfigDialog backupConfig = new BackupConfigDialog(); backupConfig.ShowDialog(); if (backupConfig.DialogResult == DialogResult.OK) { Dictionary <string, string> _args = new Dictionary <string, string>(); _args.Add("halsign_br_ip_address", backupConfig.Address.TrimEnd()); _args.Add("halsign_br_username", backupConfig.UserName); _args.Add("halsign_br_password", backupConfig.Password); BackupConfigurationAction action = new BackupConfigurationAction(this.noSetVM.Connection, this.noSetVM, _args, 0); if (action != null) { ActionProgressDialog dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks); dialog.ShowCancel = true; dialog.ShowDialog(this); } } if (!(this._xenModelObject is Host)) { Program.MainWindow.TheTabControl.SelectTab("TabPageBackup"); } } this.checkConfiguration = true; }
private void button_DeleteConfig_Click(object sender, EventArgs e) { string str_name = string.Empty; if (this.xenModelObject is Pool) { str_name = (this.xenModelObject as Pool).name_label; } else if (this.xenModelObject is VM) { str_name = (this.xenModelObject as VM).name_label; } //bool _commit = Program.MainWindow.Confirms(this.xenModelObject.Connection, Messages.CONFIRM_DELETE_BACKUP, new object[] { str_name }); bool _commit = DialogResult.OK == MessageBox.Show(this, string.Format(Messages.CONFIRM_DELETE_BACKUP, new object[] { str_name }), Messages.MESSAGEBOX_CONFIRM, MessageBoxButtons.OKCancel, MessageBoxIcon.Question); if (_commit) { BackupConfigurationAction action = new BackupConfigurationAction(this.xenModelObject.Connection, this.xenModelObject, null, 1); if (action != null) { ActionProgressDialog dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks); dialog.ShowCancel = true; dialog.ShowDialog(this); } } }
private void button_DisableBackup_Click(object sender, EventArgs e) { bool configure_enabled = false; if (this.xenModelObject is Pool) { configure_enabled = (this.xenModelObject as Pool).other_config["halsign_br_enabled"].Equals("True") ? true : false; } if (this.xenModelObject is VM) { if (this.xenModelObject is VM) { configure_enabled = (this.xenModelObject as VM).other_config["halsign_br_enabled"].Equals("True") ? true : false; } } BackupConfigurationAction action = new BackupConfigurationAction(this.xenModelObject.Connection, this.xenModelObject, configure_enabled); if (action != null) { ActionProgressDialog dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks); dialog.ShowCancel = true; dialog.ShowDialog(this); } }
private void button_ConfigBackup_Click(object sender, EventArgs e) { Program.AssertOnEventThread(); backupConfig.ShowDialog(); // Blocking for a long time, check we haven't had the dialog disposed under us if (Disposing || IsDisposed) { return; } if (backupConfig.DialogResult == DialogResult.Cancel) { backupConfig.ClearPassword(); return; } if (backupConfig.DialogResult == DialogResult.OK) { Dictionary <string, string> _args = new Dictionary <string, string>(); _args.Add("halsign_br_ip_address", backupConfig.Address.TrimEnd()); _args.Add("halsign_br_username", backupConfig.UserName); _args.Add("halsign_br_password", backupConfig.Password); BackupConfigurationAction action = new BackupConfigurationAction(this.xenModelObject.Connection, this.xenModelObject, _args, 0); if (action != null) { ActionProgressDialog dialog = new ActionProgressDialog(action, ProgressBarStyle.Blocks); dialog.ShowCancel = true; dialog.ShowDialog(this); if (action.Exception == null) { this.Rebuild(); } } } }