/// <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); }
//*************************************************************************** // Public Methods // /// <summary> /// Adds a new method to this DynaClass object. /// </summary> /// <param name="newMethod">An AosDynaMethod object containing the details of the method you want to add.</param> public void AddMethod(DynaMethod newMethod) { this._dynaCls.Members.Add(newMethod.TypeMember); }
/// <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); }
//*************************************************************************** // Static Methods // public static void AddToMember(ref DynaMethod memberObj, string LiteralExpression) { memberObj.AddStatement(LiteralExpression); }
//*************************************************************************** // Public Methods // public void AddToMember(ref DynaMethod value) { value.AddStatement(this); }