Ejemplo n.º 1
0
        //// <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);
            }
        }
Ejemplo n.º 2
0
    public static void Main()
    {
        object obj = new onefield();
        IJson  j   = IlCreator.CreateSerializer(obj.GetType());
        String t   = j.ToJson(obj);

        Console.Write(t);
    }
Ejemplo n.º 3
0
        /// <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();
        }
Ejemplo n.º 4
0
 /// <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));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 向指定配置项写入对象。
 /// </summary>
 /// <param name="settingName">要写入配置项的名称。</param>
 /// <param name="obj">要写入的对象。</param>
 public void SetObject(string settingName, object obj)
 {
     PlayerPrefs.SetString(settingName, m_Json.ToJson(obj));
 }
Ejemplo n.º 6
0
 internal static byte[] WrapJsonOutput(IJson json)
 {
     return WrapJsonOutput(json.ToJson());
 }
Ejemplo n.º 7
0
        public static T DeepColne <T>(IJson source) where T : IJson
        {
            string jsonString = source.ToJson();

            return(Parse <T>(jsonString));
        }
Ejemplo n.º 8
0
 protected string ToJson(IJson obj)
 {
     return(obj.ToJson());
 }
Ejemplo n.º 9
0
 /// <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();
 }
Ejemplo n.º 10
0
 internal static byte[] WrapJsonOutput(IJson json)
 {
     return(WrapJsonOutput(json.ToJson()));
 }