本文整理汇总了C#中SelectedItemCollection.GetConnectionOfAllItems方法的典型用法代码示例。如果您正苦于以下问题:C# SelectedItemCollection.GetConnectionOfAllItems方法的具体用法?C# SelectedItemCollection.GetConnectionOfAllItems怎么用?C# SelectedItemCollection.GetConnectionOfAllItems使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectedItemCollection
的用法示例。
在下文中一共展示了SelectedItemCollection.GetConnectionOfAllItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
// Can execute criteria: A selection of VMs in the same pool, where at least one doesn't have PVS read caching enabled
if (selection.Any() && selection.AllItemsAre<VM>() && selection.GetConnectionOfAllItems() != null)
{
var vms = selection.AsXenObjects<VM>();
if (vms.Any(vm => vm.PvsProxy != null))
{
return true;
}
}
return false;
}
示例2: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
// Must have a selection, of all VMs
if (selection.Any() && selection.AllItemsAre<VM>())
{
// Must all be in the same pool, which must have at least one PVS site
var connection = selection.GetConnectionOfAllItems();
if (connection == null || !connection.Cache.PVS_sites.Any())
{
return false;
}
// At least one must not currently have a PVS Proxy
var vms = selection.AsXenObjects<VM>();
if (vms.Any(vm => vm.PvsProxy == null))
{
return true;
}
}
return false;
}
示例3: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
return selection.Count > 0 && selection.AllItemsAre<VM>()
&& selection.GetConnectionOfAllItems() != null && selection.Any(CanExecute);
}