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;
| }
|
|
| }
| }
|
|