增加日志
This commit is contained in:
@ -120,6 +120,40 @@ namespace DH.Commons.Enums
|
||||
.FirstOrDefault() as DescriptionAttribute;
|
||||
return attribute?.Description ?? value.ToString();
|
||||
}
|
||||
|
||||
public static System.Drawing.Color GetEnumSelectedColor(this Enum enumObj)
|
||||
{
|
||||
Type t = enumObj.GetType();
|
||||
FieldInfo f = t.GetField(enumObj.ToString());
|
||||
|
||||
ColorSelectAttribute attr = f.GetCustomAttribute<ColorSelectAttribute>();
|
||||
if (attr != null)
|
||||
{
|
||||
return System.Drawing.Color.FromName(attr.SelectedColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
return System.Drawing.Color.Transparent;
|
||||
}
|
||||
}
|
||||
|
||||
public static System.Drawing.Color GetEnumSelectedFontColor(this Enum enumObj)
|
||||
{
|
||||
Type t = enumObj.GetType();
|
||||
FieldInfo f = t.GetField(enumObj.ToString());
|
||||
|
||||
var attr = f.GetCustomAttribute<FontColorSelectAttribute>();
|
||||
if (attr != null)
|
||||
{
|
||||
return System.Drawing.Color.FromName(attr.SelectedColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
return System.Drawing.Color.Transparent;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Flags]
|
||||
public enum DeviceAttributeType
|
||||
{
|
||||
@ -303,7 +337,44 @@ namespace DH.Commons.Enums
|
||||
// NG = -1,
|
||||
// IGNORE = -999,
|
||||
//}
|
||||
public enum DeviceState
|
||||
{
|
||||
TBD = -1,
|
||||
|
||||
[ColorSelect("Gray")]
|
||||
[FontColorSelect("Black")]
|
||||
[Description("未初始化")]
|
||||
DSUninit = 1,
|
||||
|
||||
[ColorSelect("Gold")]
|
||||
[FontColorSelect("White")]
|
||||
[PreState(1 + 2 + 4 + 8 + 32)]
|
||||
[Description("初始化")]
|
||||
DSInit = 2,
|
||||
|
||||
[ColorSelect("Lime")]
|
||||
[FontColorSelect("Black")]
|
||||
[PreState(2 + 4 + 16)]
|
||||
[Description("运行中")]
|
||||
DSOpen = 4,
|
||||
|
||||
[ColorSelect("Gray")]
|
||||
[FontColorSelect("White")]
|
||||
[PreState(1 + 4 + 8 + 16 + 32)]
|
||||
[Description("关闭")]
|
||||
DSClose = 8,
|
||||
|
||||
[ColorSelect("Gold")]
|
||||
[FontColorSelect("White")]
|
||||
[PreState(4 + 16)]
|
||||
[Description("暂停")]
|
||||
DSPause = 16,
|
||||
|
||||
[ColorSelect("Red")]
|
||||
[FontColorSelect("White")]
|
||||
[Description("异常")]
|
||||
DSExcept = 32
|
||||
}
|
||||
public enum PriorityDirection
|
||||
{
|
||||
X,
|
||||
|
Reference in New Issue
Block a user