public T_ValidateType() : base() { this.IsEmail = new T_Field() { Name = "IsEmail", Type = T_Type.Boolean }; this.IsInt = new T_Field() { Name = "IsInt", Type = T_Type.Boolean }; this.IsFloat = new T_Field() { Name = "IsFloat", Type = T_Type.Boolean }; this.Regex = new T_Field() { Name = "Regex", Type = T_Type.String }; this.Required = new T_Field() { Name = "Required", Type = T_Type.Boolean }; this.SameTo = new T_Field() { Name = "SameTo", Type = T_Type.String }; this.Max = new T_Field() { Name = "Max", Type = T_Type.Float }; this.Min = new T_Field() { Name = "Min", Type = T_Type.Float }; this.MaxLength = new T_Field() { Name = "MaxLength", Type = T_Type.Int }; this.MinLength = new T_Field() { Name = "MinLength", Type = T_Type.Int }; this.Fields.Add(this.IsEmail); this.Fields.Add(this.IsInt); this.Fields.Add(this.IsFloat); this.Fields.Add(this.Regex); this.Fields.Add(this.Required); this.Fields.Add(this.SameTo); this.Fields.Add(this.Max); this.Fields.Add(this.Min); this.Fields.Add(this.MaxLength); this.Fields.Add(this.MinLength); }
protected override void RenderView(IndentStringBuilder builder, T_Field f, AssignOperatorInfo?op, IndentStringBuilder opValue) { if (op.HasValue) { builder.AppendFormat(".{0} {1} {2}", f.Name, op.GetDescription(), opValue); } else { builder.AppendFormat(".{0}", f.Name); } }
public T_InputType(T_Type valueType) { var type = "unknown"; if (valueType != null) { type = valueType.Name; } this.Name = string.Format("Input<{0}>", type); this.Value = new T_Field() { Name = "Value", Type = valueType }; this.Visible = new T_Field() { Name = "Visible", Type = T_Type.Boolean }; this.Enabled = new T_Field() { Name = "Enabled", Type = T_Type.Boolean }; this.Changed = new T_Field() { Name = "Changed", Type = new T_EventType("Changed") }; this.Validation = new T_Field() { Name = "Validation", Type = new T_ValidateType() }; this.Fields.Add(this.Visible); this.Fields.Add(this.Value); this.Fields.Add(this.Enabled); this.Fields.Add(this.Changed); this.Fields.Add(this.Validation); this.Methods.Add(new T_Method() { Name = "Value", Type = valueType }); this.Methods.Add(new T_Method() { Name = "Visible", Type = T_Type.Boolean }); this.Methods.Add(new T_Method() { Name = "Enabled", Type = T_Type.Boolean }); }
protected virtual void RenderView(IndentStringBuilder builder, T_Field f, AssignOperatorInfo?op, IndentStringBuilder rightBuilder) { var p = ""; if (rightBuilder != null) { p = rightBuilder.ToString(); } //builder.AppendFormat(".{0}({1})", f.Name, p); builder.AppendFormat(".{0}", f.Name); if (op.HasValue) { builder.AppendFormat("{0}{1}", op.Value.GetDescription(), rightBuilder.ToString()); } }
protected override void RenderView(IndentStringBuilder builder, T_Field f, AssignOperatorInfo?op, IndentStringBuilder opValue) { //base.RenderView(builder, f, rightBuilder); if (opValue != null && opValue.Length > 0) { builder.AppendFormat(".{0}({1})", f.Name, opValue.ToString()); } else { if (f.Type is T_EventType) { builder.AppendFormat(".{0}", f.Name); } else if (f.Type is T_ValidateType) { builder.AppendFormat(".{0}", f.Name); } else { builder.AppendFormat(".{0}()", f.Name); } } }
protected override void RenderView(IndentStringBuilder builder, T_Field f, AssignOperatorInfo? op, IndentStringBuilder opValue) { if (op.HasValue) { builder.AppendFormat(".{0} {1} {2}",f.Name, op.GetDescription(), opValue); } else { builder.AppendFormat(".{0}", f.Name); } }
protected virtual void RenderView(IndentStringBuilder builder, T_Field f,AssignOperatorInfo? op, IndentStringBuilder rightBuilder) { var p = ""; if (rightBuilder != null) p = rightBuilder.ToString(); //builder.AppendFormat(".{0}({1})", f.Name, p); builder.AppendFormat(".{0}", f.Name); if (op.HasValue) { builder.AppendFormat("{0}{1}",op.Value.GetDescription(),rightBuilder.ToString()); } }
protected override void RenderView(IndentStringBuilder builder, T_Field f,AssignOperatorInfo? op, IndentStringBuilder opValue) { //base.RenderView(builder, f, rightBuilder); if (opValue != null && opValue.Length > 0) { builder.AppendFormat(".{0}({1})",f.Name, opValue.ToString()); } else { if (f.Type is T_EventType) { builder.AppendFormat(".{0}", f.Name); } else if (f.Type is T_ValidateType) { builder.AppendFormat(".{0}", f.Name); } else { builder.AppendFormat(".{0}()", f.Name); } } }