本文整理汇总了C#中SelectedItemCollection.GetConnectionOfFirstItem方法的典型用法代码示例。如果您正苦于以下问题:C# SelectedItemCollection.GetConnectionOfFirstItem方法的具体用法?C# SelectedItemCollection.GetConnectionOfFirstItem怎么用?C# SelectedItemCollection.GetConnectionOfFirstItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectedItemCollection
的用法示例。
在下文中一共展示了SelectedItemCollection.GetConnectionOfFirstItem方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteCore
protected override void ExecuteCore(SelectedItemCollection selection)
{
var con = selection.GetConnectionOfFirstItem();
if (Helpers.FeatureForbidden(con, Host.RestrictCrossPoolMigrate))
{
ShowUpsellDialog(Parent);
}
else
{
MainWindowCommandInterface.ShowPerConnectionWizard(con,
new CrossPoolMigrateWizard(con, selection, preSelectedHost, WizardMode.Copy));
}
}
示例2: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
IXenConnection connection = selection.GetConnectionOfFirstItem();
bool atLeastOneCanExecute = false;
foreach (SelectedItem item in selection)
{
//all items should be VMs
VM vm = item.XenObject as VM;
if (vm == null)
return false;
// all VMs must be on the same connection
if (connection != null && vm.Connection != connection)
return false;
//at least one VM should be able to execute
if (CanExecute(vm))
atLeastOneCanExecute = true;
}
return atLeastOneCanExecute;
}
示例3: ExecuteCore
protected override void ExecuteCore(SelectedItemCollection selection)
{
var con = selection.GetConnectionOfFirstItem();
MainWindowCommandInterface.ShowPerConnectionWizard(con, new ImportWizard(con, selection.FirstAsXenObject, null, false));
}
示例4: ExecuteCore
protected override void ExecuteCore(SelectedItemCollection selection)
{
var vdis = selection.AsXenObjects<VDI>();
new MoveVirtualDiskDialog(selection.GetConnectionOfFirstItem(), vdis, null).Show(Program.MainWindow);
}
示例5: ExecuteCore
protected override void ExecuteCore(SelectedItemCollection selection)
{
var con = selection.GetConnectionOfFirstItem();
MainWindowCommandInterface.ShowPerConnectionWizard(con, new ExportApplianceWizard(con, selection));
}