示例#1
0
 public new bool Equals(object x, object y)
 {
     if (x == y)
     {
         return(true);
     }
     if (x == null || y == null)
     {
         return(false);
     }
     if (type == null)
     {
         Type = x.GetType();
     }
     if (eq == null)
     {
         eq = CompareFunctions.GetEqualityComparer(type, TargetType);
     }
     return(eq.Equals(x, y));
 }
示例#2
0
 public int Compare(object x, object y)
 {
     if (x == y)
     {
         return(0);
     }
     if (x == null)
     {
         return(-factor);
     }
     if (y == null)
     {
         return(factor);
     }
     if (type == null)
     {
         Type = x.GetType();
     }
     if (comp == null)
     {
         comp = CompareFunctions.GetComparer(type, TargetType);
     }
     return(factor * comp.Compare(x, y));
 }