ReverseComparer.cs 410 B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Utilities
  4. {
  5. public class ReverseComparer<T> : IComparer<T>
  6. {
  7. private IComparer<T> m_comparer;
  8. public ReverseComparer(IComparer<T> comparer)
  9. {
  10. m_comparer = comparer;
  11. }
  12. public int Compare(T x, T y)
  13. {
  14. return m_comparer.Compare(y, x);
  15. }
  16. }
  17. }