在类里面实现CompareTo的方法,并return要进行比较的成员,然后就可以使用sort函数对class数组进行排序了。
public class SignList : IComparable<SignList>
{
public string Fimage { get; set; }
public long Ftime { get; set; }
public int CompareTo(SignList other)
{
return Ftime.CompareTo(other.Ftime);
}
}