本文整理匯總了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;
}