//// <inheritdoc /> public void AddProductTable <T>(List <T> productTable) { string str = m_Json.ToJson(productTable); LTLog.Debug($"AddProductTable:{str}"); if (m_BridgeClass != null) { m_BridgeClass.CallStatic("addProductTable", str); } }
public static void Main() { object obj = new onefield(); IJson j = IlCreator.CreateSerializer(obj.GetType()); String t = j.ToJson(obj); Console.Write(t); }
/// <summary> /// Send a JSON message to the command. First 2 bytes is size of message. /// </summary> /// <remarks> /// This is used by both asynchronous and no result commands. /// </remarks> /// <param name="json">The JSON string to send.</param> internal void SendJsonCommand(IJson json) { #if DEBUG if (Log.IsDebugEnabled) { Log.Debug("Send: " + json.ToJson()); } #endif Stream output = _process.StandardInput.BaseStream; byte[] msg = JsonMsgUtil.WrapJsonOutput(json); output.Write(msg, 0, msg.Length); output.Flush(); }
/// <summary> /// 将指定对象转换为Json /// </summary> /// <typeparam name="T"></typeparam> /// <param name="target">要转换的对象</param> /// <returns>Json字符串</returns> public static string ToJson <T>(T target) { return(_json.ToJson(target)); }
/// <summary> /// 向指定配置项写入对象。 /// </summary> /// <param name="settingName">要写入配置项的名称。</param> /// <param name="obj">要写入的对象。</param> public void SetObject(string settingName, object obj) { PlayerPrefs.SetString(settingName, m_Json.ToJson(obj)); }
internal static byte[] WrapJsonOutput(IJson json) { return WrapJsonOutput(json.ToJson()); }
public static T DeepColne <T>(IJson source) where T : IJson { string jsonString = source.ToJson(); return(Parse <T>(jsonString)); }
protected string ToJson(IJson obj) { return(obj.ToJson()); }
/// <summary> /// Send a JSON message to the command. First 2 bytes is size of message. /// </summary> /// <remarks> /// This is used by both asynchronous and no result commands. /// </remarks> /// <param name="json">The JSON string to send.</param> internal void SendJsonCommand(IJson json) { #if DEBUG if (Log.IsDebugEnabled) Log.Debug("Send: " + json.ToJson()); #endif Stream output = _process.StandardInput.BaseStream; byte[] msg = JsonMsgUtil.WrapJsonOutput(json); output.Write(msg, 0, msg.Length); output.Flush(); }
internal static byte[] WrapJsonOutput(IJson json) { return(WrapJsonOutput(json.ToJson())); }