当前位置: 首页>>代码示例>>C#>>正文


C# VM.FindVMCDROM方法代码示例

本文整理汇总了C#中XenAPI.VM.FindVMCDROM方法的典型用法代码示例。如果您正苦于以下问题:C# VM.FindVMCDROM方法的具体用法?C# VM.FindVMCDROM怎么用?C# VM.FindVMCDROM使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XenAPI.VM的用法示例。


在下文中一共展示了VM.FindVMCDROM方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SingleVMExecute

        /// <summary>
        /// Attempts to install tools on the vm
        /// </summary>
        /// <param name="vm"></param>
        /// <returns>null if user cancels or an AsyncAction. This is either the InstallPVToolsAction or the CreateCdDriveAction if the VM needed a DVD drive.</returns>
        private AsyncAction SingleVMExecute(VM vm)
        {
            if (vm.FindVMCDROM() == null)
            {
                if (new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(
                            null,
                            Messages.NEW_DVD_DRIVE_REQUIRED,
                            Messages.XENCENTER),
                        ThreeButtonDialog.ButtonYes,
                        ThreeButtonDialog.ButtonNo).ShowDialog(Parent) == DialogResult.Yes)
                {
                    MainWindowCommandInterface.AllowHistorySwitch();
                    CreateCdDriveAction createDriveAction = new CreateCdDriveAction(vm, true,NewDiskDialog.ShowMustRebootBoxCD,NewDiskDialog.ShowVBDWarningBox);
                    new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee).ShowDialog(Parent);

                    if (createDriveAction.Succeeded)
                    {
                        ShowMustRebootBox();
                    }
                    return createDriveAction;
                }
            }
            else
            {
                DialogResult dr = new InstallToolsWarningDialog(vm.Connection).ShowDialog(Parent);
                if (dr == DialogResult.Yes)
                {
                    MainWindowCommandInterface.AllowHistorySwitch();
                    InstallPVToolsAction installToolsAction = new InstallPVToolsAction( vm, XSToolsSRNotFound, Properties.Settings.Default.ShowHiddenVMs);
                    installToolsAction.Completed += InstallToolsActionCompleted;

                    installToolsAction.RunAsync();
                    return installToolsAction;
                }
            }
            return null;
        }
开发者ID:ChrisH4rding,项目名称:xenadmin,代码行数:43,代码来源:InstallToolsCommand.cs

示例2: SingleVMExecute

        /// <summary>
        /// Attempts to install tools on the vm
        /// </summary>
        /// <param name="vm"></param>
        /// <returns>null if user cancels or an AsyncAction. This is either the InstallPVToolsAction or the CreateCdDriveAction if the VM needed a DVD drive.</returns>
        private AsyncAction SingleVMExecute(VM vm)
        {
            if (vm.FindVMCDROM() == null)
            {
                DialogResult dialogResult;
                using (var dlg = new ThreeButtonDialog(
                        new ThreeButtonDialog.Details(
                            null,
                            Messages.NEW_DVD_DRIVE_REQUIRED,
                            Messages.XENCENTER),
                        ThreeButtonDialog.ButtonYes,
                        ThreeButtonDialog.ButtonNo))
                {
                    dialogResult = dlg.ShowDialog(Parent);
                }
                if (dialogResult == DialogResult.Yes)
                {
                    CreateCdDriveAction createDriveAction = new CreateCdDriveAction(vm, true,NewDiskDialog.ShowMustRebootBoxCD,NewDiskDialog.ShowVBDWarningBox);
                    using (var dlg = new ActionProgressDialog(createDriveAction, ProgressBarStyle.Marquee))
                    {
                        dlg.ShowDialog(Parent);
                    }

                    if (createDriveAction.Succeeded)
                    {
                        ShowMustRebootBox();
                    }
                    return createDriveAction;
                }
            }
            else
            {
                DialogResult dr = new InstallToolsWarningDialog(vm.Connection).ShowDialog(Parent);
                if (dr == DialogResult.Yes)
                {
                    var installToolsAction = new InstallPVToolsAction(vm, Properties.Settings.Default.ShowHiddenVMs);
                    installToolsAction.Completed += InstallToolsActionCompleted;

                    installToolsAction.RunAsync();
                    return installToolsAction;
                }
            }
            return null;
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:49,代码来源:InstallToolsCommand.cs


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