public static string Encode(JsonItem jsonItem, int formatting = 2, bool printcomment = true) { JsonEncoder jsonEncoder = new JsonEncoder { formattingtype = formatting }; jsonEncoder.printComment = printcomment; jsonEncoder.rootItem = jsonItem; return(jsonEncoder.EncodeJson(jsonItem)); }
public string ToJson() { return(JsonEncoder.Encode(this, 2, true)); }