AvalonStudio.Projects.Solution.FindProject C# (CSharp) Method

FindProject() public method

public FindProject ( string name ) : IProject
name string
return IProject
		public IProject FindProject(string name)
		{
			var result = Projects.FirstOrDefault(project => project.Name == name);

			if (result == null)
			{
				throw new Exception($"Unable to find project with name {name}");
			}

			return result;
		}

Usage Example

Beispiel #1
0
		private static IProject FindProject(Solution solution, string project)
		{
			try
			{
				return solution.FindProject(project);
			}
			catch (Exception e)
			{
				console.WriteLine(e.Message);
				return null;
			}
		}