using System;
namespace AnticipatingMinds.Genesis.CodeDOM{
/// <summary>
/// Represents a solution.
/// </summary>
/// <remarks>
/// Solution class is a binder for multiple assemblies. CodeSolution basicly represents VS.NET solution.
/// </remarks>
[Serializable()]
public class CodeSolution
{
public CodeSolution():this(String.Empty)
{
}
/// <summary>
/// Initializes new instance of the <see cref="CodeSolution"/> class.
/// </summary>
/// <param name="modelName">Solution name.</param>
public CodeSolution(string modelName)
{
Name = modelName;
}
/// <summary>
/// Gets or sets solution name.
/// </summary>
public string Name
{
get
{
return name;
}
set
{
name = value == null ? string.Empty:value;
}
}
/// <summary>
/// Gets a collection of assemblies that are members of the solution.
/// </summary>
public CodeAssemblyCollection Assemblies
{
get
{
return assemblyCollection;
}
}
/// <summary>
/// Finds an assembly base on assembly file name.
/// </summary>
/// <param name="assemblyFileName">Assembly file name.</param>
/// <returns>
/// Returns a reference to code assembly or null if assembly with such file name was not found.
/// </returns>
/// <remarks>assemblyFileName should be provided without path information.</remarks>
public CodeAssembly GetCodeAssembly(string assemblyFileName)
{
foreach(CodeAssembly codeAssembly in Assemblies)
if(String.Compare(codeAssembly.AssemblyFileName,assemblyFileName,true) == 0)
return codeAssembly;
return null;
}
private CodeAssemblyCollection assemblyCollection = new CodeAssemblyCollection();
private string name;
}
}
|