Ejemplo n.º 1
0
 // 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]);
     }
 }
Ejemplo n.º 2
0
 public void ReverseSort(WhichIsFirst theDelegate)
 {
     if (theDelegate(thePair[0], thePair[1]) == Comparison.theFirstComesFirst)
     {
         object temp = thePair[0];
         thePair[0] = thePair[1];
         thePair[1] = temp;
     }
 }
Ejemplo n.º 3
0
 // 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;
     }
 }
Ejemplo n.º 4
0
 public void ReverseSort(WhichIsFirst theDelegatedFunc)
 {
     if (theDelegatedFunc(first, second) == Comparison.theFirstComesFromFirst)
     {
         T temp = first;
         first  = second;
         second = temp;
     }
 }
Ejemplo n.º 5
0
        //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;
            }
        }