using System; using System.Collections.Generic; using System.Text; namespace Pub_Class { public class ClsListItem:IComparable { public int TabIndex; public string Text; public string Value; public ClsListItem(int i, string t, string v) { TabIndex = i; Text = t; Value = v; } #region IComparable 成员 public int CompareTo(object obj) { if (obj is ClsListItem) { ClsListItem temp = obj as ClsListItem; return this.TabIndex.CompareTo(temp.TabIndex); } throw new NotImplementedException("obj is not a Student!"); } #endregion } }