public static void Sort <T>(T[] array, Net.Vpc.Upa.Impl.Util.IndexedComparator <T> comparator) { Net.Vpc.Upa.Impl.Util.IndexedItem <T>[] x = new Net.Vpc.Upa.Impl.Util.IndexedItem <T> [array.Length]; for (int i = 0; i < x.Length; i++) { x[i] = new Net.Vpc.Upa.Impl.Util.IndexedItem <T>(array[i], i); } System.Collections.Generic.IComparer <Net.Vpc.Upa.Impl.Util.IndexedItem <T> > comparator2 = new Net.Vpc.Upa.Impl.Util.IndexedItemComparator <T>(comparator); System.Array.Sort(x, (System.Collections.IComparer)comparator2); }
public virtual int Compare(Net.Vpc.Upa.Impl.Util.IndexedItem <T> o1, Net.Vpc.Upa.Impl.Util.IndexedItem <T> o2) { return(comparator.Compare(o1.GetItem(), o2.GetItem(), o1.GetIndex(), o2.GetIndex())); }