/// <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 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> /// Adds a new property to this DynaClass object. /// </summary> /// <param name="newProperty">A DynaProperty object containing the details of the property you want to add.</param> public void AddProperty(DynaProperty newProperty) { this._dynaCls.Members.Add(newProperty.TypeMember); }