本文整理汇总了C#中SelectedItemCollection.Any方法的典型用法代码示例。如果您正苦于以下问题:C# SelectedItemCollection.Any方法的具体用法?C# SelectedItemCollection.Any怎么用?C# SelectedItemCollection.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectedItemCollection
的用法示例。
在下文中一共展示了SelectedItemCollection.Any方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
//Clearwater doesn't has WLB
if (selection.Any(s => Helpers.IsClearwater(s.Connection)))
return false;
if (selection.Count == 1)
{
IXenConnection connection = selection[0].Connection;
Pool pool = selection[0].PoolAncestor;
bool inPool = pool != null;
return inPool && (Helpers.WlbConfigured(pool.Connection) || Helpers.FeatureForbidden(connection, Host.RestrictWLB));
}
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)
{
// 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;
}
示例4: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
//Clearwater doesn't has WLB
if (selection.Any(s => Helpers.IsClearwater(s.Connection)))
return false;
if (selection.Count == 1)
{
IXenConnection connection = selection[0].Connection;
bool inPool = selection[0].PoolAncestor != null;
return inPool &&
(((WlbServerState.GetState(selection[0].PoolAncestor) != WlbServerState.ServerState.NotConfigured) &&
(WlbServerState.GetState(selection[0].PoolAncestor) != WlbServerState.ServerState.Unknown)) ||
Helpers.FeatureForbidden(connection, Host.RestrictWLB));
}
return false;
}
示例5: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
return selection.AllItemsAre<Host>() && selection.Any(item => ((Host)item.XenObject).IsLive);
}
示例6: CanExecuteCore
protected override bool CanExecuteCore(SelectedItemCollection selection)
{
return selection.Count > 0 && selection.AllItemsAre<VM>()
&& selection.GetConnectionOfAllItems() != null && selection.Any(CanExecute);
}