using System; namespace MAX.Core.Helpers; public class CommonItem : IComparable { /// /// 初始化 /// /// 文本 /// 值 /// 排序号 /// 组 /// 禁用 public CommonItem(string text, object value, string des = "", int? sortId = null, string group = null, bool? disabled = null) { Text = text; Value = value; Description = des; SortId = sortId; Group = group; Disabled = disabled; } /// /// 文本 /// public string Text { get; } /// /// 值 /// public object Value { get; protected set; } /// /// 描述 /// public string Description { get; set; } /// /// 排序号 /// public int? SortId { get; set; } /// /// 组 /// public string Group { get; } /// /// 是否选中 /// public bool IsSelected { get; set; } /// /// 禁用 /// public bool? Disabled { get; } /// /// 比较 /// /// 其它列表项 public int CompareTo(CommonItem other) { return string.Compare(Text, other.Text, StringComparison.CurrentCulture); } } public class CommonItem : CommonItem { public new T Value { get { return (T)base.Value; } set { base.Value = value; } } public CommonItem(string text, T value, string des = "", int? sortId = null, string group = null, bool? disabled = null) : base(text, value, des, sortId, group, disabled) { } }