我有一个任务状态的枚举。有些状态被认为是过时的,我已将它们标记为过时,如下所示:
public enum TaskStatus
{
[Description("")]
NotSet = 0,
Pending = 1,
Ready = 2,
Open = 3,
Completed = 4,
Closed = 5,
[Description("On Hold")][Obsolete]
OnHold = 6,
[Obsolete]
Canceled = 7
}
在我的用户界面中,我使用枚举值填充下拉列表,但我想忽略那些标记为过时的值。我该怎么做呢?