// public method which orders the two objects // by the reverse of whatever criteria the object likes! public void ReverseSort(WhichIsFirst theDelegatedFunc) { if (theDelegatedFunc(thePair[0], thePair[1]) == Comparison.theFirstComesFirst) { Swap(ref thePair [0], ref thePair [1]); } }
public void ReverseSort(WhichIsFirst theDelegate) { if (theDelegate(thePair[0], thePair[1]) == Comparison.theFirstComesFirst) { object temp = thePair[0]; thePair[0] = thePair[1]; thePair[1] = temp; } }
// metoda publkica pentru ordonarea celor 2 obiecte dupa orice criteriu public void Sort(WhichIsFirst theDelegatedMethod) { if (theDelegatedMethod(thePair[0], thePair[1]) == Comparision.TheSecondComesFirst) { object tmp = thePair[0]; thePair[0] = thePair[1]; thePair[1] = tmp; } }
public void ReverseSort(WhichIsFirst theDelegatedFunc) { if (theDelegatedFunc(first, second) == Comparison.theFirstComesFromFirst) { T temp = first; first = second; second = temp; } }
//public method which orders the two objects by whatever criteria public void Sort(WhichIsFirst theDelegateFunc) { if (theDelegateFunc(thePair[0], thePair[1]) == Comparison.TheSecondComesFirst) { object temp = thePair[0]; thePair[0] = thePair[1]; thePair[1] = temp; } }