using System;
using System.IO;
using System.Collections;
using System.Collections.Specialized;
namespace AnticipatingMinds.Genesis.CodeDOM{
/// <summary>
/// Represents a code assembly.
/// </summary>
[Serializable()]
public class CodeAssembly
{
/// <summary>
/// Initializaes a new instance of <see cref="CodeAssembly"/> class.
/// </summary>
public CodeAssembly()
{
assemblyTypeManager = new CodeAssemblyTypeManager(this);
}
/// <summary>
/// Gets a collection of all assembly files.
/// </summary>
public CodeAssemblyFileCollection AssemblyFiles
{
get
{
return assemblyFiles;
}
}
/// <summary>
/// Gets or sets assembly file name.
/// </summary>
public string AssemblyFileName
{
get
{
return fileName;
}
set
{
fileName = value == null ? string.Empty:value;
}
}
/// <summary>
/// Gets or sets assembly name.
/// </summary>
public string AssemblyName
{
get
{
return assemblyName;
}
set
{
assemblyName = value == null ? string.Empty:value;
}
}
/// <summary>
/// Paths to the assemblies referenced by this assembly
/// </summary>
public StringCollection ReferencedAssemblies
{
get
{
return referencedAssemblies;
}
}
/// <summary>
/// Gets or sets a Solution container for this assembly.
/// </summary>
/// <remarks>Solution represents a system, a complete coding solution
/// that may consist of multiple assemblis.</remarks>
public CodeSolution Solution
{
get
{
return codeSolution;
}
set
{
codeSolution = value;
}
}
/// <summary>
/// Gets a reference to a type manager.
/// </summary>
/// <remarks>Type manager contains information about all the types imported or
/// exported by assembly.
/// </remarks>
public CodeAssemblyTypeManager TypeManager
{
get
{
return assemblyTypeManager;
}
}
/// <summary>
/// Contants (DEFINEs) used to compile files in this assembly.
/// </summary>
public string[] CompilationConstants
{
get
{
return compilationConstants;
}
set
{
if(value == null)
compilationConstants = new string[0];
else
compilationConstants = value;
}
}
/// <summary>
/// Gets a dictinary object to store any data associated with code element.
/// </summary>
public IDictionary ApplicationData
{
get
{
if(applicationData == null)
{
lock(this)
{
if(applicationData == null)
applicationData = new Hashtable() as IDictionary;
}
}
return applicationData;
}
}
private CodeAssemblyFileCollection assemblyFiles = new CodeAssemblyFileCollection();
private CodeSolution codeSolution;
private StringCollection referencedAssemblies = new StringCollection();
private string fileName;
private string assemblyName;
private string[] compilationConstants = new string[0];
private CodeAssemblyTypeManager assemblyTypeManager;
private IDictionary applicationData = null;
}
}
|