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