public struct SlideObject : IComparable
{
public int Id { get; set; }
public string Title { get; set; }
public string NavUrl { get; set; }
public string ImgUrl { get; set; }
public DateTime AddDate { get; set; }
public static Comparison
//public static Comparison
//{
// return so1.AddDate.CompareTo(so2.AddDate);
//};
#region IComparable
public int CompareTo(SlideObject other)
{
return AddDate.CompareTo(other.AddDate);
}
#endregion
}
http://dotnetslackers.com/community/blogs/simoneb/archive/2007/06/20/How-to-sort-a-generic-List_3C00_T_3E00_.aspx
http://www.codeproject.com/KB/linq/Article.aspx?aid=27834
sort a generic list
Gönderen
pantepember
27 Nisan 2010 Salı
Etiketler: generic list sorting