CompareTo() 공개 메소드

public CompareTo ( object obj ) : int
obj object
리턴 int
예제 #1
0
        public int Compare(object x, object y)
        {
            if (IsNull(x) && IsNull(y))
            {
                return(0);
            }
            else if (IsNull(x))
            {
                return(-1);
            }
            else if (IsNull(y))
            {
                return(1);
            }

            ClientVersion a = x as ClientVersion;
            ClientVersion b = y as ClientVersion;

            if (IsNull(a) || IsNull(b))
            {
                throw new ArgumentException();
            }

            return(a.CompareTo(b));
        }
예제 #2
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));
 }
예제 #3
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));
        }
예제 #4
0
		public static int Compare( ClientVersion a, ClientVersion b )
		{
			if ( IsNull( a ) && IsNull( b ) )
				return 0;
			else if ( IsNull( a ) )
				return -1;
			else if ( IsNull( b ) )
				return 1;

			return a.CompareTo( b );
		}