Source Code for Me (s-c.me)

Allows you to paste souce code to blogs! Adapted for Twitter! Here is Search Form in case you missed your code.
Code:
Selected Language:
Show Linenumbers:
Short link for Twitter:
HTML:

HTML view:

Copy Source | Copy HTML
  1. class GenericComparer<T> : IComparer<T> where T : IComparable<T>
  2. {
  3.     public int Compare(T x, T y)
  4.     {
  5.         if (x != null)
  6.         {
  7.             if (y != null)
  8.             {
  9.                 return x.CompareTo(y);
  10.             }
  11.             return 1;
  12.         }
  13.         if (y != null)
  14.         {
  15.             return -1;
  16.         }
  17.         return  0;
  18.     }
  19. }




Based on Manoli.Net's CodeFormatter. Made by Topbot (c) 2008-2012