Beispiel #1
0
        public static int VersionCompare(string version, string version2)
        {
            int result = 0;
            Ver ver    = new Ver(version);
            Ver ver2   = new Ver(version2);

            if (ver.Revision != -1 || ver2.Revision != -1)
            {
                if (ver.Revision != ver2.Revision)
                {
                    result = ver.Revision < ver2.Revision ? 1 : -1;
                }
            }
            if (ver.Build != ver2.Build)
            {
                result = ver.Build < ver2.Build ? 1 : -1;
            }
            if (ver.Minor != ver2.Minor)
            {
                result = ver.Minor < ver2.Minor ? 1 : -1;
            }
            if (ver.Major != ver2.Major)
            {
                result = ver.Major < ver2.Major ? 1 : -1;
            }

            return(result);
        }
Beispiel #2
0
        public static int VersionCompare(Ver ver, Ver ver2)
        {
            int result = 0;

            if (ver.Revision != -1 || ver2.Revision != -1)
            {
                if (ver.Revision != ver2.Revision)
                {
                    result = ver.Revision < ver2.Revision ? 1 : -1;
                }
            }
            if (ver.Build != ver2.Build)
            {
                result = ver.Build < ver2.Build ? 1 : -1;
            }
            if (ver.Minor != ver2.Minor)
            {
                result = ver.Minor < ver2.Minor ? 1 : -1;
            }
            if (ver.Major != ver2.Major)
            {
                result = ver.Major < ver2.Major ? 1 : -1;
            }

            return(result);
        }