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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
| namespace Yw.WinFrmUI
| {
| /// <summary>
| /// 弯头枚举辅助类
| /// </summary>
| public class HydroElbowTypeEnumHelper
| {
|
| //字典
| private static readonly Dictionary<eElbowType, string> _dict = new Dictionary<eElbowType, string>()
| {
| { eElbowType.Short,"短径"},
| { eElbowType.Middle,"中径"},
| { eElbowType.Long,"长径"}
| };
|
| /// <summary>
| /// 获取弯头类型
| /// </summary>
| public static eElbowType? GetElbowType(string name)
| {
| if (_dict.ContainsValue(name))
| {
| return _dict.First(x => x.Value == name).Key;
| }
| return default;
| }
|
| /// <summary>
| /// 获取弯头类型名称
| /// </summary>
| public static string GetElbowTypeName(eElbowType elbowType)
| {
| if (_dict.ContainsKey(elbowType))
| {
| return _dict[elbowType];
| }
| return default;
| }
|
|
|
| }
| }
|
|