IsNull() public static method

public static IsNull ( object x ) : bool
x object
return bool
Beispiel #1
0
 public static int Compare(ClientVersion a, ClientVersion b)
 {
     if (ClientVersion.IsNull(a) && ClientVersion.IsNull(b))
     {
         return(0);
     }
     if (ClientVersion.IsNull(a))
     {
         return(-1);
     }
     if (ClientVersion.IsNull(b))
     {
         return(1);
     }
     return(a.CompareTo(b));
 }
Beispiel #2
0
        public int Compare(object x, object y)
        {
            if (ClientVersion.IsNull(x) && ClientVersion.IsNull(y))
            {
                return(0);
            }
            if (ClientVersion.IsNull(x))
            {
                return(-1);
            }
            if (ClientVersion.IsNull(y))
            {
                return(1);
            }
            ClientVersion version1 = (x as ClientVersion);
            ClientVersion version2 = (y as ClientVersion);

            if (ClientVersion.IsNull(version1) || ClientVersion.IsNull(version2))
            {
                throw new ArgumentException();
            }
            return(version1.CompareTo(version2));
        }