示例#1
0
    /// <summary>
    /// Finds the first project in the solution matching the given predicate.
    /// </summary>
    /// <param name="solution">The solution to traverse.</param>
    /// <param name="predicate">Predicate used to match projects.</param>
    /// <returns>The first project matching the given predicate, or <see langword="null"/>.</returns>
    public static IProjectNode FindProject(this ISolutionNode solution, Func <IProjectNode, bool> predicate)
    {
        var visitor = new FilteringProjectsVisitor(predicate, true);

        solution.Accept(visitor);

        return(visitor.Projects.FirstOrDefault());
    }
示例#2
0
	/// <summary>
	/// Finds the first project in the solution matching the given predicate.
	/// </summary>
	/// <param name="solution">The solution to traverse.</param>
	/// <param name="predicate">Predicate used to match projects.</param>
	/// <returns>The first project matching the given predicate, or <see langword="null"/>.</returns>
	public static IProjectNode FindProject (this ISolutionNode solution, Func<IProjectNode, bool> predicate)
	{
		var visitor = new FilteringProjectsVisitor(predicate, true);

		solution.Accept (visitor);

		return visitor.Projects.FirstOrDefault ();
	}
示例#3
0
    /// <summary>
    /// Finds all projects in the solution matching the given predicate.
    /// </summary>
    /// <param name="solution">The solution to traverse.</param>
    /// <param name="predicate">Predicate used to match projects.</param>
    /// <returns>All project nodes matching the given predicate that were found.</returns>
    public static IEnumerable <IProjectNode> FindProjects(this ISolutionNode solution, Func <IProjectNode, bool> predicate)
    {
        var visitor = new FilteringProjectsVisitor(predicate);

        solution.Accept(visitor);

        return(visitor.Projects);
    }
示例#4
0
	/// <summary>
	/// Finds all projects in the solution matching the given predicate.
	/// </summary>
	/// <param name="solution">The solution to traverse.</param>
	/// <param name="predicate">Predicate used to match projects.</param>
	/// <returns>All project nodes matching the given predicate that were found.</returns>
	public static IEnumerable<IProjectNode> FindProjects (this ISolutionNode solution, Func<IProjectNode, bool> predicate)
	{
		var visitor = new FilteringProjectsVisitor(predicate);

		solution.Accept (visitor);

		return visitor.Projects;
	}