Ejemplo n.º 1
0
        /// <summary>
        /// Verifies the given string is a valid 4-part version module or bundle version.
        /// </summary>
        /// <param name="version">The version to verify.</param>
        /// <returns>True if version is a valid module or bundle version.</returns>
        public static bool IsValidFourPartVersion(string version)
        {
            if (!Common.IsValidBinderVariable(version))
            {
                if (!Version.TryParse(version, out var ver) || 65535 < ver.Major || 65535 < ver.Minor || 65535 < ver.Build || 65535 < ver.Revision)
                {
                    return(false);
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Verifies the given string is a valid module or bundle version.
        /// </summary>
        /// <param name="version">The version to verify.</param>
        /// <returns>True if version is a valid module or bundle version.</returns>
        public static bool IsValidModuleOrBundleVersion(string version)
        {
            if (!Common.IsValidBinderVariable(version))
            {
                Version ver;

                try
                {
                    ver = new Version(version);
                }
                catch (ArgumentException)
                {
                    return(false);
                }

                if (65535 < ver.Major || 65535 < ver.Minor || 65535 < ver.Build || 65535 < ver.Revision)
                {
                    return(false);
                }
            }

            return(true);
        }