• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Dialogs.ThreeButtonDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中XenAdmin.Dialogs.ThreeButtonDialog的典型用法代码示例。如果您正苦于以下问题:C# ThreeButtonDialog类的具体用法?C# ThreeButtonDialog怎么用?C# ThreeButtonDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ThreeButtonDialog类属于XenAdmin.Dialogs命名空间,在下文中一共展示了ThreeButtonDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExecuteCore

        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            VM vm = (VM)selection[0].XenObject;

            using (var dlg = new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(
                            SystemIcons.Warning,
                            string.Format(Messages.CONVERT_TEMPLATE_DIALOG_TEXT, vm.Name.Ellipsise(25)),
                            Messages.CONVERT_TO_TEMPLATE),
                        new ThreeButtonDialog.TBDButton(Messages.CONVERT, DialogResult.OK, ThreeButtonDialog.ButtonType.ACCEPT, true),
                        ThreeButtonDialog.ButtonCancel))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    List<AsyncAction> actions = new List<AsyncAction>();
                    actions.Add(new SetVMOtherConfigAction(vm.Connection, vm, "instant", "true"));
                    actions.Add(new VMToTemplateAction(vm));

                    MainWindowCommandInterface.CloseActiveWizards(vm);

                    RunMultipleActions(actions, string.Format(Messages.ACTION_VM_TEMPLATIZING_TITLE, vm.Name),
                                       Messages.ACTION_VM_TEMPLATIZING, Messages.ACTION_VM_TEMPLATIZED, true);
                }
            }
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:25,代码来源:ConvertVMToTemplateCommand.cs


示例2: action_Completed

 protected virtual void action_Completed(ActionBase sender)
 {
     var action = (AsyncAction)sender;
     if (action.Result == false.ToString())
         MainWindowCommandInterface.Invoke(() =>
         {
             using (var dlg =new ThreeButtonDialog(
                 new ThreeButtonDialog.Details(
                     SystemIcons.Information,
                     Messages.VIF_HOTPLUG_FAILED_MESSAGE,
                     Messages.VIF_HOTPLUG_FAILED_TITLE)))
             {
                 dlg.ShowDialog(Program.MainWindow);
             }
         });
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:16,代码来源:BaseVIFCommand.cs


示例3: LaunchUrlInBrowser

 public void LaunchUrlInBrowser()
 {
     try
     {
         if (UriToLaunch != null)
             Process.Start(UriToLaunch.AbsoluteUri);
     }
     catch (Exception)
     {
         using (var dlg = new ThreeButtonDialog(
             new ThreeButtonDialog.Details(
                 SystemIcons.Error,
                 string.Format(Messages.COULD_NOT_OPEN_URL,
                               UriToLaunch != null ? UriToLaunch.AbsoluteUri : string.Empty),
                 Messages.XENCENTER)))
         {
             dlg.ShowDialog(Program.MainWindow);
         }
     }
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:20,代码来源:WarningWithInformationUrl.cs


示例4: CreateAction

        protected override AsyncAction CreateAction(out bool cancelled)
        {
            AsyncAction action = null;

            if (diskSpaceReq.CanCleanup)
            {
                Program.Invoke(Program.MainWindow, delegate()
                {
                    DialogResult r = new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(
                           SystemIcons.Warning,
                           diskSpaceReq.GetSpaceRequirementsMessage()),
                        new ThreeButtonDialog.TBDButton(Messages.YES, DialogResult.Yes, ThreeButtonDialog.ButtonType.ACCEPT, true),
                        ThreeButtonDialog.ButtonNo
                        ).ShowDialog();


                    if (r == DialogResult.Yes)
                    {
                        action = new CleanupDiskSpaceAction(this.Server, patch, true);
                    }
                });
            }
            else
            { 
                Program.Invoke(Program.MainWindow, delegate()
                {
                    new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(SystemIcons.Warning, diskSpaceReq.GetSpaceRequirementsMessage()))
                        .ShowDialog();
                });
            }
            cancelled = action == null;
            
            return action;
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:36,代码来源:HostOutOfSpaceProblem.cs


示例5: EditTask

 private void EditTask(WlbScheduledTask task)
 {
     WlbScheduledTask editTask = task.Clone();
     WlbEditScheduledTask taskEditor = new WlbEditScheduledTask(editTask);
     DialogResult dr = taskEditor.ShowDialog();
     if (DialogResult.OK == dr)
     {
         WlbScheduledTask checkTask = CheckForDuplicateTask(editTask);
         if (null != checkTask)
         {
             using (var dlg = new ThreeButtonDialog(
                new ThreeButtonDialog.Details(
                    SystemIcons.Warning,
                    Messages.WLB_TASK_SCHEDULE_CONFLICT_BLURB,
                    Messages.WLB_TASK_SCHEDULE_CONFLICT_TITLE)))
             {
                 dlg.ShowDialog(this);
             }
             SelectTask(checkTask.TaskId);
         }
         else
         {
             editTask.LastTouchedBy = _pool.Connection.Username;
             editTask.LastTouched = DateTime.UtcNow;
             _scheduledTasks.TaskList[editTask.TaskId.ToString()] = editTask;
             PopulateListView();
             _hasChanged = true;
         }
     }
 }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:30,代码来源:WlbOptModeScheduler.cs


示例6: AddTask

        private void AddTask()
        {
            WlbEditScheduledTask addTask = new WlbEditScheduledTask(_newTaskId--, WlbScheduledTask.WlbTaskActionType.SetOptimizationMode);
            DialogResult dr = addTask.ShowDialog();
            if (DialogResult.OK == dr)
            {
                WlbScheduledTask newTask = addTask.Task;
                newTask.Owner = _pool.Connection.Username;
                newTask.LastTouchedBy = _pool.Connection.Username;
                newTask.AddTaskParameter("PoolUUID", _pool.uuid);

                WlbScheduledTask checkTask = CheckForDuplicateTask(newTask);
                if (null != checkTask)
                {
                    using (var dlg = new ThreeButtonDialog(
                       new ThreeButtonDialog.Details(
                           SystemIcons.Warning,
                           Messages.WLB_TASK_SCHEDULE_CONFLICT_BLURB,
                           Messages.WLB_TASK_SCHEDULE_CONFLICT_TITLE)))
                    {
                        dlg.ShowDialog(this);
                    }
                    SelectTask(checkTask.TaskId);
                }
                else
                {
                    _scheduledTasks.TaskList.Add(newTask.TaskId.ToString(), newTask);
                    PopulateListView();
                    _hasChanged = true;
                }
            }
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:32,代码来源:WlbOptModeScheduler.cs


示例7: ToolStripMenuItemDismiss_Click

        private void ToolStripMenuItemDismiss_Click(object sender, EventArgs e)
        {
            if (dataGridViewUpdates.SelectedRows.Count != 1)
                log.DebugFormat("Only 1 update can be dismissed at a time (Attempted to dismiss {0}). Dismissing the clicked item.", dataGridViewUpdates.SelectedRows.Count);

            DataGridViewRow clickedRow = FindAlertRow(sender as ToolStripMenuItem);
            if (clickedRow == null)
            {
                log.Debug("Attempted to dismiss update with no update selected.");
                return;
            }

            Alert alert = (Alert)clickedRow.Tag;
            if (alert == null)
                return;

            using (var dlog = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(null, Messages.UPDATE_DISMISS_CONFIRM, Messages.XENCENTER),
                    ThreeButtonDialog.ButtonYes,
                    ThreeButtonDialog.ButtonNo))
            {
                if (dlog.ShowDialog(this) != DialogResult.Yes)
                    return;
            }

            DismissUpdates(new List<Alert> { (Alert)clickedRow.Tag });
        }
开发者ID:robhoes,项目名称:xenadmin,代码行数:27,代码来源:ManageUpdatesPage.cs


示例8: dismissAllToolStripMenuItem_Click

        /// <summary>
        /// If the answer of the user to the dialog is YES, then make a list with all the updates and call 
        /// DismissUpdates on that list.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dismissAllToolStripMenuItem_Click(object sender, EventArgs e)
        {

            DialogResult result;

            if (!FilterIsOn)
            {
                using (var dlog = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(null, Messages.UPDATE_DISMISS_ALL_NO_FILTER_CONTINUE),
                    new ThreeButtonDialog.TBDButton(Messages.DISMISS_ALL_YES_CONFIRM_BUTTON, DialogResult.Yes),
                    ThreeButtonDialog.ButtonCancel))
                {
                    result = dlog.ShowDialog(this);
                }
            }
            else
            {
                using (var dlog = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(null, Messages.UPDATE_DISMISS_ALL_CONTINUE),
                    new ThreeButtonDialog.TBDButton(Messages.DISMISS_ALL_CONFIRM_BUTTON, DialogResult.Yes),
                    new ThreeButtonDialog.TBDButton(Messages.DISMISS_FILTERED_CONFIRM_BUTTON, DialogResult.No, ThreeButtonDialog.ButtonType.NONE),
                    ThreeButtonDialog.ButtonCancel))
                {
                    result = dlog.ShowDialog(this);
                }
            }

            if (result == DialogResult.Cancel)
                return;

            var alerts = result == DialogResult.No
                         ? from DataGridViewRow row in dataGridViewUpdates.Rows select row.Tag as Alert
                         : Updates.UpdateAlerts;

            DismissUpdates(alerts);
        }
开发者ID:robhoes,项目名称:xenadmin,代码行数:42,代码来源:ManageUpdatesPage.cs


示例9: EditWLB

        internal void EditWLB(Pool pool)
        {
            // Do nothing if there is a WLB action in progress
            if (HelpersGUI.FindActiveWLBAction(pool.Connection) != null)
            {
                log.Debug("Not opening WLB dialog: an WLB action is in progress");
                return;
            }

            if (!pool.Connection.IsConnected)
            {
                log.Debug("Not opening WLB dialog: the connection to the pool is now closed");
                return;
            }

            try
            {
                WlbConfigurationDialog wlbConfigDialog = new WlbConfigurationDialog(pool);
                DialogResult dr = wlbConfigDialog.ShowDialog();

                if (dr == DialogResult.OK)
                {
                    _wlbPoolConfiguration = wlbConfigDialog.WlbPoolConfiguration;

                    //check to see if the current opt mode matches the current schedule
                    if (_wlbPoolConfiguration.AutomateOptimizationMode)
                    {
                        WlbPoolPerformanceMode scheduledPerfMode = _wlbPoolConfiguration.ScheduledTasks.GetCurrentScheduledPerformanceMode();
                        if (scheduledPerfMode != _wlbPoolConfiguration.PerformanceMode)
                        {
                            string blurb = string.Format(Messages.WLB_PROMPT_FOR_MODE_CHANGE_BLURB, getOptModeText(scheduledPerfMode), getOptModeText(_wlbPoolConfiguration.PerformanceMode));
                            DialogResult drModeCheck = new ThreeButtonDialog(
                                new ThreeButtonDialog.Details(null, blurb, Messages.WLB_PROMPT_FOR_MODE_CHANGE_CAPTION),
                                ThreeButtonDialog.ButtonYes,
                                ThreeButtonDialog.ButtonNo).ShowDialog(this);

                            if (drModeCheck == DialogResult.Yes)
                            {
                                _wlbPoolConfiguration.PerformanceMode = scheduledPerfMode;
                            }
                        }
                    }
                    SaveWLBConfig(_wlbPoolConfiguration);
                }
            }
            catch (Exception ex)
            {
                log.Debug("Unable to open the WLB configuration dialog.", ex);
                return;
            }

            if (!(WlbServerState.GetState(_pool) == WlbServerState.ServerState.NotConfigured))
            {
                RetrieveConfiguration();
            }
        }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:56,代码来源:WLBPage.cs


示例10: FiberChannelScan

        public bool FiberChannelScan(IWin32Window owner, IXenConnection connection, out List<FibreChannelDevice> devices)
        {
            devices = new List<FibreChannelDevice>();

            Host master = Helpers.GetMaster(connection);
            if (master == null)
                return false;

            FibreChannelProbeAction action = new FibreChannelProbeAction(master, SrType);
            using (var  dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
                dialog.ShowDialog(owner); //Will block until dialog closes, action completed

            if (!action.Succeeded)
                return false;

            try
            {
                devices = FibreChannelProbeParsing.ProcessXML(action.Result);

                if (devices.Count == 0)
                {
                    using (var dlg = new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_NO_RESULTS, Messages.XENCENTER)))
                    {
                        dlg.ShowDialog();
                    }

                    return false;
                }
                return true;
            }
            catch (Exception e)
            {
                log.Debug("Exception parsing result of fibre channel scan", e);
                log.Debug(e, e);
                using (var dlg = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.FIBRECHANNEL_XML_ERROR, Messages.XENCENTER)))
                {
                    dlg.ShowDialog();
                }

                return false;
            }
        }
开发者ID:vtsingaras,项目名称:xenadmin,代码行数:44,代码来源:LVMoHBA.cs


示例11: SetTreeViewReportList

        /// <summary>
        /// Populates the treeview with ReportInfo and SubscriptionInfo nodes
        /// </summary>
        private void SetTreeViewReportList()
        {
            bool errorLoading = false;

            // Prep treeview for population
            treeViewReportList.BeginUpdate();
            treeViewReportList.Nodes.Clear();

            // Set up the image list for the tree
            this.treeViewReportList.ImageList = CreateReportImageList();

            //_subscriptionCollection = null;

            try
            {
                // retrieve subscription
                SetSubscriptionCollection();

                if (_isMROrLater && _subscriptionCollection != null && !_isBostonOrLater)
                {
                    this.wlbReportView1.btnSubscribe.Visible = true;
                }
                else
                {
                    this.wlbReportView1.btnSubscribe.Visible = false;
                }

                this.wlbReportView1.btnLaterReport.Visible = false;
                this.wlbReportView1.IsCreedenceOrLater = _isCreedenceOrLater;
                PopulateTreeView();
            }
            catch (XenAdmin.CancelledException xc)
            {
                // User cancelled entering credentials when prompted by action
                log.Debug(xc);
                errorLoading = true;
            }
            catch (Exception ex)
            {
                log.Debug(ex, ex);
                using (var dlg = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Error, Messages.WLBREPORT_REPORT_CONFIG_ERROR, Messages.XENCENTER)))
                {
                    dlg.ShowDialog(this);
                }
                errorLoading = true;
            }
            finally
            {
                if ((treeViewReportList != null) && (!errorLoading))
                    treeViewReportList.EndUpdate();
                else
                    this.Close();
            }
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:57,代码来源:WorkloadReports.cs


示例12: OnChangeOK_Refresh

        /// <summary>
        /// Update report treeView and subscription treeView
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnChangeOK_Refresh(object sender, EventArgs e)
        {
            try
            {
                // set _subscriptionCollection
                SetSubscriptionCollection();

                // Start update treeViews
                if (_subscriptionCollection != null)
                {
                    // Update subscription treeView must be before updating report treeView
                    this.UpdateSubscriptionTreeView();

                    // Update report treeView
                    this.UpdateReportTreeView();

                    // Rebuild panel if ReportSubscriptionView is visible
                    if (sender is WlbReportSubscriptionView)
                    {
                        this.subscriptionView1.BuildPanel();
                    }
                }
            }
            catch (Exception ex)
            {
                log.Debug(ex, ex);
                using (var dlg = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Error, Messages.WLBREPORT_REPORT_CONFIG_ERROR, Messages.XENCENTER)))
                {
                    dlg.ShowDialog(this);
                }
                this.Close();
            }
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:38,代码来源:WorkloadReports.cs


示例13: deleteSavedSearch_Click

        private void deleteSavedSearch_Click(object sender, EventArgs e)
        {
            var item = sender as ToolStripItem;
            if (item == null)
                return;

            var search = item.Tag as Search;
            if (search == null)
                return;

            using (var dlog = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Warning,
                        String.Format(Messages.DELETE_SEARCH_PROMPT, search.Name),
                        String.Format(Messages.DELETE_SEARCH, search.Name)),
                    ThreeButtonDialog.ButtonYes,
                    ThreeButtonDialog.ButtonNo))
            {
                if (dlog.ShowDialog(this) == DialogResult.Yes)
                    new SearchAction(search, SearchAction.Operation.delete).RunAsync();
            }
        }
开发者ID:huizh,项目名称:xenadmin,代码行数:21,代码来源:SearchPage.cs


示例14: ScanForSRs

        private void ScanForSRs(SR.SRTypes type)
        {
            var srs = new List<SR.SRInfo>();

            switch (type)
            {
                case SR.SRTypes.lvmohba:
                    var devices = FiberChannelScan();
                    if (devices != null && devices.Count > 0)
                    {
                        foreach (FibreChannelDevice device in devices)
                        {
                            string deviceId = string.IsNullOrEmpty(device.SCSIid) ? device.Path : device.SCSIid;
                            var metadataSrs = ScanDeviceForSRs(SR.SRTypes.lvmohba, deviceId, GetFCDeviceConfig(device));
                            if (metadataSrs != null && metadataSrs.Count > 0)
                                srs.AddRange(metadataSrs);
                        }
                    }
                    AddScanResultsToDataGridView(srs, SR.SRTypes.lvmohba);
                    break;

                case SR.SRTypes.lvmoiscsi:
                    using (var dialog = new IscsiDeviceConfigDialog(Connection))
                    {
                        if (dialog.ShowDialog(this) == DialogResult.OK)
                        {
                            Dictionary<String, String> dconf = dialog.DeviceConfig;
                            string deviceId = string.IsNullOrEmpty(dconf[SCSIID]) ? dconf[LUNSERIAL] : dconf[SCSIID];

                            var metadataSrs = ScanDeviceForSRs(SR.SRTypes.lvmoiscsi, deviceId, dconf);
                            if (metadataSrs != null && metadataSrs.Count > 0)
                                srs.AddRange(metadataSrs);
                        }
                    }
                    AddScanResultsToDataGridView(srs, SR.SRTypes.lvmoiscsi);
                    break;
            }

            if (srs.Count == 0)
                using (var dlg = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Information,
                        Messages.DR_WIZARD_STORAGEPAGE_SCAN_RESULT_NONE,
                        Messages.XENCENTER)))
                {
                    dlg.ShowDialog(this);
                }
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:47,代码来源:DRFailoverWizardStoragePage.cs


示例15: ExecuteCore

        protected override void ExecuteCore(SelectedItemCollection selection)
        {
            Dictionary<SelectedItem, string> reasons = new Dictionary<SelectedItem, string>();
            foreach (Host host in _hosts)
            {
                PoolJoinRules.Reason reason = PoolJoinRules.CanJoinPool(host.Connection, _pool.Connection, true, true, true);
                if (reason != PoolJoinRules.Reason.Allowed)
                    reasons[new SelectedItem(host)] = PoolJoinRules.ReasonMessage(reason);
            }

            if (reasons.Count > 0)
            {
                string title = Messages.ERROR_DIALOG_ADD_TO_POOL_TITLE;
                string text = string.Format(Messages.ERROR_DIALOG_ADD_TO_POOL_TEXT, Helpers.GetName(_pool).Ellipsise(500));

                new CommandErrorDialog(title, text, reasons).ShowDialog(Parent);
                return;
            }

            if (_confirm && !ShowConfirmationDialog())
            {
                // Bail out if the user doesn't want to continue.
                return;
            }

            if (!Helpers.IsConnected(_pool))
            {
                string message = _hosts.Count == 1
                                     ? string.Format(Messages.ADD_HOST_TO_POOL_DISCONNECTED_POOL,
                                                     Helpers.GetName(_hosts[0]).Ellipsise(500), Helpers.GetName(_pool).Ellipsise(500))
                                     : string.Format(Messages.ADD_HOST_TO_POOL_DISCONNECTED_POOL_MULTIPLE,
                                                     Helpers.GetName(_pool).Ellipsise(500));

                using (var dlg = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(SystemIcons.Error, message, Messages.XENCENTER)))
                {
                    dlg.ShowDialog(Parent);
                }
                return;
            }

            // Check supp packs and warn
            List<string> badSuppPacks = PoolJoinRules.HomogeneousSuppPacksDiffering(_hosts, _pool);
            if (!HelpersGUI.GetPermissionFor(badSuppPacks, sp => true,
                Messages.ADD_HOST_TO_POOL_SUPP_PACK, Messages.ADD_HOST_TO_POOL_SUPP_PACKS, false, "PoolJoinSuppPacks"))
            {
                return;
            }

            // Are there any hosts which are forbidden from masking their CPUs for licensing reasons?
            // If so, we need to show upsell.
            Host master = Helpers.GetMaster(_pool);
            if (null != _hosts.Find(host =>
                !PoolJoinRules.CompatibleCPUs(host, master, false) &&
                Helpers.FeatureForbidden(host, Host.RestrictCpuMasking) &&
                !PoolJoinRules.FreeHostPaidMaster(host, master, false)))  // in this case we can upgrade the license and then mask the CPU
            {
                using (var  dlg = new UpsellDialog(HiddenFeatures.LinkLabelHidden ? Messages.UPSELL_BLURB_CPUMASKING : Messages.UPSELL_BLURB_CPUMASKING + Messages.UPSELL_BLURB_CPUMASKING_MORE,
                                                    InvisibleMessages.UPSELL_LEARNMOREURL_CPUMASKING))
                    dlg.ShowDialog(Parent);
                return;
            }

            // Get permission for any fix-ups: 1) Licensing free hosts; 2) CPU masking 3) Ad configuration 4) CPU feature levelling (Dundee or higher only)
            // (We already know that these things are fixable because we have been through CanJoinPool() above).
            if (!HelpersGUI.GetPermissionFor(_hosts, host => PoolJoinRules.FreeHostPaidMaster(host, master, false),
                Messages.ADD_HOST_TO_POOL_LICENSE_MESSAGE, Messages.ADD_HOST_TO_POOL_LICENSE_MESSAGE_MULTIPLE, true, "PoolJoinRelicensing")
                ||
                !HelpersGUI.GetPermissionFor(_hosts, host => !PoolJoinRules.CompatibleCPUs(host, master, false),
                Messages.ADD_HOST_TO_POOL_CPU_MASKING_MESSAGE, Messages.ADD_HOST_TO_POOL_CPU_MASKING_MESSAGE_MULTIPLE, true, "PoolJoinCpuMasking")
                ||
                !HelpersGUI.GetPermissionFor(_hosts, host => !PoolJoinRules.CompatibleAdConfig(host, master, false),
                Messages.ADD_HOST_TO_POOL_AD_MESSAGE, Messages.ADD_HOST_TO_POOL_AD_MESSAGE_MULTIPLE, true, "PoolJoinAdConfiguring")
                ||
                !HelpersGUI.GetPermissionForCpuFeatureLevelling(_hosts, _pool))
            {
                return;
            }

            MainWindowCommandInterface.SelectObjectInTree(_pool);

            List<AsyncAction> actions = new List<AsyncAction>();
            foreach (Host host in _hosts)
            {
                string opaque_ref = host.opaque_ref;
                AddHostToPoolAction action = new AddHostToPoolAction(_pool, host, GetAdPrompt, NtolDialog, ApplyLicenseEditionCommand.ShowLicensingFailureDialog);
                action.Completed += s => Program.ShowObject(opaque_ref);
                actions.Add(action);

                // hide connection. If the action fails, re-show it.
                Program.HideObject(opaque_ref);
            }

            RunMultipleActions(actions, string.Format(Messages.ADDING_SERVERS_TO_POOL, _pool.Name), Messages.POOLCREATE_ADDING, Messages.POOLCREATE_ADDED, true);
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:95,代码来源:AddHostToPoolCommand.cs


示例16: RestoreDefaultGraphs

 private void RestoreDefaultGraphs()
 {
     using (ThreeButtonDialog dlog = new ThreeButtonDialog(
             new ThreeButtonDialog.Details(SystemIcons.Warning,
                 Messages.GRAPHS_RESTORE_DEFAULT_MESSAGE,
                 Messages.XENCENTER),
             ThreeButtonDialog.ButtonYes,
             ThreeButtonDialog.ButtonNo))
     {
         if (dlog.ShowDialog(this) == DialogResult.Yes)
             if (GraphList.AuthorizedRole)
             {
                 GraphList.RestoreDefaultGraphs();
                 GraphList.LoadDataSources(SaveGraphs);
             }
     }
 }
开发者ID:aaroneg,项目名称:xenadmin,代码行数:17,代码来源:PerformancePage.cs


示例17: listViewExPowerManagementHosts_ItemCheck

 private void listViewExPowerManagementHosts_ItemCheck(object sender, ItemCheckEventArgs e)
 {
     if (!_loading)
     {
         if (listViewExPowerManagementHosts.Items[e.Index].Tag is Host)
         {
             Host host = (Host)listViewExPowerManagementHosts.Items[e.Index].Tag;
             if (!HostCannotParticipateInPowerManagement(host))
             {
                 if (e.NewValue == CheckState.Checked &&
                     (!_poolConfiguration.HostConfigurations.ContainsKey(host.uuid) ||
                      !_poolConfiguration.HostConfigurations[host.uuid].LastPowerOnSucceeded))
                 {
                     DialogResult dr =
                         new ThreeButtonDialog(
                         new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.WLB_UNTESTED_HOST_WARNING, Messages.WLB_UNTESTED_HOST_CAPTION),
                         ThreeButtonDialog.ButtonYes,
                         ThreeButtonDialog.ButtonNo).ShowDialog();
                     if (dr == DialogResult.No)
                     {
                         e.NewValue = e.CurrentValue;
                     }
                     else
                     {
                         _hasChanged = true;
                     }
                 }
                 else
                 {
                     _hasChanged = true;
                 }
             }
             else
             {
                 e.NewValue = CheckState.Unchecked;
             }
         }
     }
 }
开发者ID:agimofcarmen,项目名称:xenadmin,代码行数:39,代码来源:WlbAutomationPage.cs


示例18: wlbReportView1_PoolConnectionLost

        /// <summary>
        /// Event handler for a lost pool connection
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void wlbReportView1_PoolConnectionLost(object sender, EventArgs e)
        {
            using (var dlg = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Information, String.Format(Messages.WLB_REPORT_POOL_CONNECTION_LOST, _pool.Name), Messages.WLBREPORT_POOL_CONNECTION_LOST_CAPTION)))
            {
                dlg.ShowDialog(this);
            }

            this.Close();
            this.Dispose();
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:15,代码来源:WorkloadReports.cs


示例19: PageLeave

        public override void PageLeave(PageLoadedDirection direction, ref bool cancel)
        {
            if (direction == PageLoadedDirection.Back)
                return;

            Host master = Helpers.GetMaster(Connection);
            if (master == null)
            {
                cancel = true;
                return;
            }

            SrDescriptors = new List<LvmOhbaSrDescriptor>();

            var existingSrDescriptors = new List<LvmOhbaSrDescriptor>();
            var formatDiskDescriptors = new List<LvmOhbaSrDescriptor>();

            foreach (var device in _selectedDevices)
            {
                LvmOhbaSrDescriptor descr = CreateSrDescriptor(device);

                var action = new SrProbeAction(Connection, master, SrType, descr.DeviceConfig);
                using (var dlg = new ActionProgressDialog(action, ProgressBarStyle.Marquee))
                    dlg.ShowDialog(this);

                if (!action.Succeeded)
                {
                    cancel = true;
                    return;
                }

                descr.UUID = SrWizardHelpers.ExtractUUID(action.Result);

                if (!string.IsNullOrEmpty(SrWizardType.UUID))
                {
                    // Check LUN contains correct SR
                    if (descr.UUID == SrWizardType.UUID)
                    {
                        SrDescriptors.Add(descr);
                        continue;
                    }

                    using (var dlog = new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(SystemIcons.Error,
                            String.Format(Messages.INCORRECT_LUN_FOR_SR, SrWizardType.SrName), Messages.XENCENTER)))
                    {
                        dlog.ShowDialog(this);
                    }

                    cancel = true;
                    return;
                }

                if (string.IsNullOrEmpty(descr.UUID))
                {
                    // No existing SRs were found on this LUN. If allowed to create
                    // a new SR, ask the user if they want to proceed and format.
                    if (!SrWizardType.AllowToCreateNewSr)
                    {
                        using (var dlog = new ThreeButtonDialog(
                            new ThreeButtonDialog.Details(SystemIcons.Error,
                                Messages.NEWSR_LUN_HAS_NO_SRS, Messages.XENCENTER)))
                        {
                            dlog.ShowDialog(this);
                        }

                        cancel = true;
                        return;
                    }

                    if (!Program.RunInAutomatedTestMode)
                        formatDiskDescriptors.Add(descr);
                }
                else
                {
                    // CA-17230: Check this isn't a detached SR. If it is then just continue
                    SR sr = SrWizardHelpers.SrInUse(descr.UUID);
                    if (sr != null)
                    {
                        SrDescriptors.Add(descr);
                        continue;
                    }

                    // We found a SR on this LUN. Will ask user for choice later.
                    existingSrDescriptors.Add(descr);
                }
            }

            if (!cancel && existingSrDescriptors.Count > 0)
            {
                var launcher = new LVMoHBAWarningDialogLauncher(this, existingSrDescriptors, true);
                launcher.ShowWarnings();
                cancel = launcher.Cancelled;
                if (!cancel && launcher.SrDescriptors.Count > 0)
                    SrDescriptors.AddRange(launcher.SrDescriptors);
            }

            if (!cancel && formatDiskDescriptors.Count > 0)
            {
                var launcher = new LVMoHBAWarningDialogLauncher(this, formatDiskDescriptors, false);
//.........这里部分代码省略.........
开发者ID:vtsingaras,项目名称:xenadmin,代码行数:101,代码来源:LVMoHBA.cs


示例20: ToolStripMenuItemDismiss_Click

        private void ToolStripMenuItemDismiss_Click(object sender, EventArgs e)
        {
            if (GridViewAlerts.SelectedRows.Count != 1)
                log.DebugFormat("Only 1 alert can be dismissed at a time (Attempted to dismiss {0}). Dismissing the clicked item.", GridViewAlerts.SelectedRows.Count);

            DataGridViewRow clickedRow = FindAlertRow(sender as ToolStripMenuItem);
            if (clickedRow == null)
            {
                log.Debug("Attempted to dismiss alert with no alert selected.");
                return;
            }

            Alert alert = (Alert)clickedRow.Tag;
            if (alert == null)
                return;

            if (!Properties.Settings.Default.DoNotConfirmDismissAlerts)
            {
                using (var dlog = new ThreeButtonDialog(
                    new ThreeButtonDialog.Details(null, Messages.ALERT_DISMISS_CONFIRM, Messages.XENCENTER),
                    ThreeButtonDialog.ButtonYes,
                    ThreeButtonDialog.ButtonNo)
                {
                    ShowCheckbox = true,
                    CheckboxCaption = Messages.DO_NOT_SHOW_THIS_MESSAGE
                })
                {
                    var result = dlog.ShowDialog(this);
                    Properties.Settings.Default.DoNotConfirmDismissAlerts = dlog.IsCheckBoxChecked;
                    Settings.TrySaveSettings();

                    if (result != DialogResult.Yes)
                        return;
                }
            }

            DismissAlerts(new List<Alert> {(Alert) clickedRow.Tag});
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:38,代码来源:AlertSummaryPage.cs



注:本文中的XenAdmin.Dialogs.ThreeButtonDialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Syntax.Log_MethodImpl类代码示例发布时间:2022-05-26
下一篇:
C# Dialogs.ActionProgressDialog类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap