/// <summary> /// Provides a simple container and methods for building a CodeDOM-based class. /// </summary> /// <param name="ClassName">A string value containing the name of this class.</param> /// <param name="Scope">A value of type MemberAttributes which defines the scope of this class.</param> public DynaClass(string ClassName, System.CodeDom.MemberAttributes Scope) { this._dynaCls = new CodeTypeDeclaration(ClassName); this._dynaCls.Attributes = Scope; }
/// <summary> /// Creates a new field member within this DynaClass object. /// </summary> /// <param name="Name">A string value containing the name of the new field.</param> /// <param name="ValueType">A Type class object indicating the data-type of the new field.</param> /// <param name="GetStatements">An array of DynaStatement objects containing the expression statements contained within the 'Set' portion of the field.</param> /// <param name="SetStatements">An array of DynaStatement objects containing the expression statements contained within the 'Get' portion of the field.</param> /// <param name="Scope">A value of type MemberAttributes indicating the scope of this field.</param> public void CreateProperty(string Name, Type ValueType, DynaExpression[] SetStatements, DynaExpression[] GetStatements, System.CodeDom.MemberAttributes Scope) { DynaProperty prop = new DynaProperty(Name, ValueType, Scope); foreach (DynaExpression stmt in SetStatements) { prop.AddSetStatement(stmt); } foreach (DynaExpression stmt in GetStatements) { prop.AddGetStatement(stmt); } this.AddProperty(prop); }
/// <summary> /// Creates a new entry point member within this DynaClass object. /// When adding this class to an DynaCode object containing other classes, there should be only *one* (1) EntryPoint for the entire DynaCode object. /// </summary> /// <param name="Arguements">An array of DynaArguement objects containing the incoming arguements for the new entry point.</param></param> /// <param name="Statements">An array of DynaStatement objects containing the expression statements contained within the new entry point.</param></param> /// <param name="Scope">A value of type MemberAttributes indicating the scope of this class constructor.</param> public void CreateEntryPoint(DynaArgument[] Arguements, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope) { DynaEntryPoint ep = new DynaEntryPoint(); ep.TypeMember.Attributes = Scope; foreach (DynaExpression stmt in Statements) { ep.TypeMember.Statements.Add(stmt.Expression); } AddEntryPoint(ep); }
/// <summary> /// Creates a new class constructor member within this AosDynaClass object. /// </summary> /// <param name="Arguements">An array of DynaArguement objects containing the incoming arguements for this class constructor.</param> /// <param name="Statements">An array of DynaStatement objects containing the expression statements contained within this class constructor.</param> /// <param name="Scope">A value of type MemberAttributes indicating the scope of this class constructor.</param> public void CreateConstructor(DynaArgument[] Arguments, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope) { DynaConstructor cc = new DynaConstructor(); cc.TypeMember.Attributes = Scope; foreach (DynaExpression stmt in Statements) { cc.TypeMember.Statements.Add(stmt.Expression); } AddConstructor(cc); }
/// <summary> /// Creates a new method member within this DynaClass object. /// </summary> /// <param name="Name">A string value containing the name of the new method.</param> /// <param name="Arguements">An array of DynaArguement objects specifying the incoming arguements for the new methdod.</param> /// <param name="Statements">An array of DynaStatement objects specifying the expression statements contained within this method.</param> /// <param name="Scope">A value of type MemberAttributes indicating the scope of the new method.</param> public void CreateMethod(string Name, DynaArgument[] Arguements, DynaExpression[] Statements, System.CodeDom.MemberAttributes Scope) { DynaMethod dm = new DynaMethod(Name); dm.TypeMember.Attributes = Scope; foreach (DynaExpression stmt in Statements) { dm.TypeMember.Statements.Add(stmt.Expression); } AddMethod(dm); }
protected override System.CodeDom.MemberAttributes ModifyMemberAttributes(System.CodeDom.MemberAttributes memberAttributes) { return(base.ModifyMemberAttributes(memberAttributes) | MemberAttributes.Static); }