public override string BuildCode(int indented = 0) { StringBuilder b = new StringBuilder(); b.Append(JSBuilder.GetIndented(indented)); b.Append(VariableName); b.Append(" = "); if (!IsValueType) { b.Append(((JSBObject)VariableValue).BuildCode(indented)); } else { b.Append(JSBObject.BuildValue(VariableValue, indented)); } b.Append(";"); return(b.ToString()); }
public string BuildCode(int indented = 0) { StringBuilder builder = new StringBuilder(); builder.Append("["); int i = 0; foreach (object obj in Collection) { builder.Append(JSBObject.BuildValue(obj, indented)); if (i < Collection.Count - 1) { builder.Append(", "); } i++; } builder.Append("]"); return(builder.ToString()); }