From 5215a463afd281f62ecd67b2ae87d37404174287 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期一, 28 八月 2023 15:41:59 +0800 Subject: [PATCH] 2023年08月28日15:41:39 --- HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs index a073cc9..1263bbf 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs @@ -1,5 +1,6 @@ 锘縰sing System; using System.Collections.Generic; +using System.Linq; using Shared; namespace HDL_ON.UI.UI2.Intelligence.Automation { @@ -1304,6 +1305,61 @@ return value; } + + /// <summary> + /// 鑾峰彇key鍊� + /// </summary> + /// <param name="value"></param> + /// <returns>涓嶅瓨鍦ㄨ繑鍥炵┖瀛楃鈥溾��</returns> + public string GetKey(Dictionary<string, string> dic, string value) + { + if (string.IsNullOrEmpty(value)) { + return string.Empty; + } + if (dic==null||dic.Count==0) + { + return string.Empty; + } + //濡傛灉鍑虹幇澶氫釜鐩稿悓Value锛岃繖閲岄粯璁よ繑鍥炴槸绗竴涓猭ey鍊� + var key = dic.FirstOrDefault(q => q.Value == value).Key; + return key == null ? string.Empty : key; + } + + /// <summary> + /// 鑾峰彇value鍊� + /// </summary> + /// <param name="key">閿�</param> + /// <returns>涓嶅瓨鍦ㄨ繑鍥炵┖瀛楃鈥溾��</returns> + public string GetValue(Dictionary<string, string> dic, string key) + { + if (string.IsNullOrEmpty(key)) + { + return string.Empty; + } + if (dic == null || dic.Count == 0) + { + return string.Empty; + } + string value = string.Empty; + dic.TryGetValue(key, out value); + return value == null ? string.Empty : value; + } + /// <summary> + /// 鑾峰彇娴蜂俊鐢佃淇″彿婧愬垪琛�( 0:LiveTV;2:PS;3:HDMI_1;4:HDMI_2;5:HDMI_3;6:HDMI_4;11:AV;) + /// </summary> + /// <returns></returns> + public Dictionary<string, string> GetHisenseSignalSourceDic() + { + var dic = new Dictionary<string, string>(); + dic.Add("HDML 1", "3"); + dic.Add("HDML 2", "4"); + dic.Add("HDML 3", "5"); + dic.Add("HDML 4", "6"); + dic.Add("Live TV", "0"); + dic.Add("PS", "2"); + dic.Add("AV", "11"); + return dic; + } } } -- Gitblit v1.8.0