Hi,
Here is a code example:
/////////////////////////////////////////////////////////////////
CodeTypeDeclaration cls = new CodeTypeDeclaration("ChildClass");
cls.IsClass = true;
cls.BaseTypes.Add("BaseClass");
CodeConstructor cons = new CodeConstructor();
cons.Attributes = MemberAttributes.Public;
cons.Parameters.Add(new CodeParameterDeclarationExpression(typeof(string),
"sometext"));
cons.BaseConstructorArgs.Add(new
CodeArgumentReferenceExpression("sometext"));
cls.Members.Add(cons);
/////////////////////////////////////////////////////////////////
It produces code like this:
public class ChildClass : BaseClass
{
public ChildClass(string sometext) :
base(sometext)
{
}
}