static int Clear(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); LitJson.JsonData obj = (LitJson.JsonData)ToLua.CheckObject(L, 1, typeof(LitJson.JsonData)); obj.Clear(); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public void PropertiesOrderTest () { JsonData data = new JsonData (); string json = "{\"first\":\"one\",\"second\":\"two\"," + "\"third\":\"three\",\"fourth\":\"four\"}"; for (int i = 0; i < 10; i++) { data.Clear (); data["first"] = "one"; data["second"] = "two"; data["third"] = "three"; data["fourth"] = "four"; Assert.AreEqual (json, data.ToJson ()); } }
private void button2_Click(object sender, EventArgs e) { JsonData data = new JsonData(); string json = "{\"first\":\"one\",\"second\":\"two\"," + "\"third\":\"three\",\"fourth\":\"four\"}"; for (int i = 0; i < 10; i++) { data.Clear(); data["first"] = "one"; data["second"] = "two"; data["third"] = "three"; data["fourth"] = "four"; json += data.ToJson(); } }