From ea0b1e8e5f43c5fd0a7d479e25ede3b8cbea464a Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期一, 02 十二月 2024 17:17:19 +0800 Subject: [PATCH] tcp;可视对讲; --- HDL_ON/Common/Utlis.cs | 37 ++++++++++++++++++++++++++++++++----- 1 files changed, 32 insertions(+), 5 deletions(-) diff --git a/HDL_ON/Common/Utlis.cs b/HDL_ON/Common/Utlis.cs index 13a4af0..e93393c 100644 --- a/HDL_ON/Common/Utlis.cs +++ b/HDL_ON/Common/Utlis.cs @@ -20,11 +20,38 @@ #endif } - /// <summary> - /// 寮圭獥鎻愮ず - /// </summary> - /// <param name="mes"></param> - public static void ShowAlertOnMainThread(string mes) + /// <summary> + /// 鍏ㄥ眬鎵撳嵃 + /// </summary> + /// <param name="tag">鎻忚堪淇℃伅</param> + /// <param name="url">璇锋眰鍦板潃(鍙互鏍规嵁鍦板潃杩囨护璇ユ暟鎹�)</param> + /// <param name="content">淇℃伅鍐呭</param> + public static void WriteLine(string tag, string url, string content) + { + return; +#if DEBUG + if (url == "") + { + return; + } + if (!string.IsNullOrEmpty(content)) + { + if (content.StartsWith("{") && content.EndsWith("}")) + { + //瀹屽叏鏄负浜嗘墦鍗板ソ鐪嬩竴鐐�,娌$壒娈婃剰涔�; + content = Newtonsoft.Json.JsonConvert.DeserializeObject(content)?.ToString(); + } + } + string text = tag + "======" + url + "\r\n" + content; + Console.WriteLine(text); +#endif + } + + /// <summary> + /// 寮圭獥鎻愮ず + /// </summary> + /// <param name="mes"></param> + public static void ShowAlertOnMainThread(string mes) { Application.RunOnMainThread(() => { new Alert("", mes, Language.StringByID(StringId.Close)).Show(); -- Gitblit v1.8.0