lixiaojun
2025-04-09 9aa8106d88fc3070498493e2819922f7ac31746e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 字典拓展
    /// </summary>
    public static class DictionaryExtensions
    {
        /// <summary>
        /// 
        /// </summary>
        public static TValve GetValue<TValve>(this Dictionary<string, TValve> dict, string key)
        {
            if (dict == null || dict.Count < 1)
            {
                return default;
            }
            if (string.IsNullOrEmpty(key))
            {
                return default;
            }
            if (dict.ContainsKey(key))
            {
                return dict[key];
            }
            return default;
        }
 
 
    }
}