本文整理汇总了C#中ThoughtWorks.CruiseControl.Remote.ProjectStatus.Select方法的典型用法代码示例。如果您正苦于以下问题:C# ProjectStatus.Select方法的具体用法?C# ProjectStatus.Select怎么用?C# ProjectStatus.Select使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThoughtWorks.CruiseControl.Remote.ProjectStatus
的用法示例。
在下文中一共展示了ProjectStatus.Select方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FilterQueues
/// <summary>
/// Filters a list of queues and only returns the queues for the projects that a user is allowed to view.
/// </summary>
/// <param name="sessionToken">The session token to use in filtering.</param>
/// <param name="filteredProjects">The already filtered projects.</param>
/// <param name="queueSet">The set of queues to filter.</param>
/// <returns>The filtered set.</returns>
private QueueSetSnapshot FilterQueues(string sessionToken, ProjectStatus[] filteredProjects, QueueSetSnapshot queueSet)
{
var allowedQueues = new QueueSetSnapshot();
var userName = securityManager.GetUserName(sessionToken);
var defaultIsAllowed = (securityManager.GetDefaultRight(SecurityPermission.ViewProject) == SecurityRight.Allow);
foreach (QueueSnapshot queue in queueSet.Queues)
{
if (filteredProjects.Select(x => x.Queue).Contains(queue.QueueName))
allowedQueues.Queues.Add(queue);
}
return allowedQueues;
}