本文整理汇总了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;
}
示例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;
}