lixiaojun
2025-02-07 d107fd0519b4b84c31bc55bbd30cc0ba0af7507d
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
45
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 过渡件类型枚举辅助类
    /// </summary>
    public class HydroTranslationTypeEnumHelper
    {
 
        //字典
        private static readonly Dictionary<eTranslationType, string> _dict = new Dictionary<eTranslationType, string>()
        {
            { eTranslationType.GradualContraction,"渐缩变径"},
            { eTranslationType.EccentricContraction,"偏心渐缩"},
            { eTranslationType.EccentricExpansion,"偏心渐扩"},
            { eTranslationType.GradualExpansion,"渐扩变径"},
        };
 
        /// <summary>
        /// 获取过渡件类型
        /// </summary>
        public static eTranslationType? GetTranslationType(string name)
        {
            if (_dict.ContainsValue(name))
            {
                return _dict.First(x => x.Value == name).Key;
            }
            return default;
        }
 
        /// <summary>
        /// 获取过渡件类型名称
        /// </summary>
        public static string GetTranslationTypeName(eTranslationType translationType)
        {
            if (_dict.ContainsKey(translationType))
            {
                return _dict[translationType];
            }
            return default;
        }
 
 
 
    }
}