public int Compare( object x, object y )
{
if ( x == null && y == null )
return 0;
else if ( x == null )
return -1;
else if ( y == null )
return 1;
if ( !(x is DictionaryEntry) || !(y is DictionaryEntry) )
throw new ArgumentException();
DictionaryEntry de1 = (DictionaryEntry)x;
DictionaryEntry de2 = (DictionaryEntry)y;
Type a = (Type)de1.Key;
Type b = (Type)de2.Key;
return GetDistance( a ).CompareTo( GetDistance( b ) );
}
}