Use IComparer Generic Interface.
This interface provides
public int Compare(object x, object y)
you overiddes this method and implement yours, so simple right?
Example:
A delicious related to this topic!
public class MyComparer : IComparer
{
public MyComparer() { }
public int Compare(object x, object y)
{
return DateTime.Compare(((MyClass)x).EntryDate, ((MyClass)y).EntryDate);
}
}
No comments:
Post a Comment