| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using Shared; |
| | | namespace HDL_ON.UI.UI2.Intelligence.Automation |
| | | { |
| | |
| | | /// <param name="stateList">之前状态数据源</param> |
| | | /// <param name="titleText">标题</param> |
| | | /// <param name="action">返回值索引值</param> |
| | | /// <param name="isIcon">数据源没有数据是否显示提示图标(默认(true)显示)</param> |
| | | public void FrameOrVv(FrameLayout frame, List<string> list, List<string> stateList, string titleText, Action<int> action,bool isIcon=true) |
| | | { |
| | | |
| | |
| | | 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,这里默认返回是第一个key值 |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | } |