using System;
using System.Collections;
using System.Collections.Specialized;
namespace AnticipatingMinds.Genesis.CodeDOM{
/// <summary>
/// Constructor of a class
/// </summary>
/// <remarks>Constructor is the same kind of creature as method with only difference
/// that it has base initializer and its arguments. One can say that constructor doesnot have return value
/// but it is not true. Constructor's return value in C# is void. Some other language may want to return
/// value from constructor.</remarks>
[Serializable]
public class CodeTypeConstructorDeclaration : CodeTypeMethodDeclaration
{
/// <summary>
/// Represents different types constructor initialization.
/// </summary>
public enum ConstructorInitializerType
{
/// <summary>
/// No references.
/// </summary>
None,
/// <summary>
/// Initialize through base class constructor.
/// </summary>
Base,
/// <summary>
/// Initialize through one of the overloaded contructors.
/// </summary>
This
}
/// <summary>
/// Initializes new instance of the <see cref="CodeTypeConstructorDeclaration"/> class.
/// </summary>
/// <remarks>
/// The name of the constructor is alwaus ".ctor".
/// </remarks>
public CodeTypeConstructorDeclaration(): base ()
{
this.Name = ".ctor";
}
/// <summary>
/// Gets or sets constructor initializer type.
/// </summary>
/// <remarks>ECMA 334 - p. 261, line 31.</remarks>
public ConstructorInitializerType InitializerType
{
get
{
return initializerType;
}
set
{
initializerType = value;
}
}
/// <summary>
/// Gets constructor initializer type arguments collection.
/// </summary>
/// <remarks>ECMA 334 - p. 261, line 31.</remarks>
public CodeArgumentCollection InitializerArguments
{
get
{
return initializerArguments;
}
}
private ConstructorInitializerType initializerType = ConstructorInitializerType.None;
private CodeArgumentCollection initializerArguments = new CodeArgumentCollection();
}
}
|