public void AddConstructor() { Con = this.VarValue; // Declare the constructor CodeConstructor constructor = new CodeConstructor(); constructor.Attributes = MemberAttributes.Public; constructor.Parameters.Add(new CodeParameterDeclarationExpression(Type, Con)); CodeFieldReferenceExpression widthReference = new CodeFieldReferenceExpression(new CodeThisReferenceExpression(), Con); constructor.Statements.Add(new CodeAssignStatement(widthReference, new CodeArgumentReferenceExpression(Con))); targetClass.Members.Add(constructor); }
public MyCode(String val) { this.val = val; }
public MyCode() { val = "Value"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)