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


C# SelectedItemCollection.Any方法代码示例

本文整理汇总了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;
        }
开发者ID:PlusCloudsOSS,项目名称:xenadmin,代码行数:16,代码来源:DisconnectWlbServerCommand.cs

示例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;
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:22,代码来源:EnablePvsReadCachingCommand.cs

示例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;
        }
开发者ID:ushamandya,项目名称:xenadmin,代码行数:14,代码来源:DisablePvsReadCachingCommand.cs

示例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;
        }
开发者ID:slamj1,项目名称:xenadmin,代码行数:18,代码来源:ViewWorkloadReportsCommand.cs

示例5: CanExecuteCore

 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return selection.AllItemsAre<Host>() && selection.Any(item => ((Host)item.XenObject).IsLive);
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:4,代码来源:RestartToolstackCommand.cs

示例6: CanExecuteCore

 protected override bool CanExecuteCore(SelectedItemCollection selection)
 {
     return selection.Count > 0 && selection.AllItemsAre<VM>()
            && selection.GetConnectionOfAllItems() != null && selection.Any(CanExecute);
 }
开发者ID:huizh,项目名称:xenadmin,代码行数:5,代码来源:StartVMOnHostToolStripMenuItem.cs


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