>public class MyArrayListSorter: IComparer >{ > #region Methods > public virtual int Compare(object x, object y) >Where do object x and object y come from? Also, does this code go in the same .cs file as I am currently working in (like a method or procedure in VFP) or does it go in a separate file?
> { > string s1, s2; > > s1 = x.ToString().Trim(); > s2 = y.ToString().Trim(); > > s1 = s1.Substring(s1.Length() - 9); > s2 = s2.Substring(s2.Length() - 9); > > if (s1.Trim().Length > 0) > d1 = DateTime.Parse(s1); > else > d1 = new DateTime(1900, 1, 1); > > if (s2.Trim().Length > 0) > d2 = DateTime.Parse(s2); > else > d2 = new DateTime(1900, 1, 1); > > if (d1 < d2) {return -1;} > else if (d1 > d2) {return 1;} > else {return 0;} > } >I can see this comparing two dates, but how does it compare a date with all of the other dates?