From a46ef0eebafea0e5b38c0c6e960be778c2dbb852 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 19 Jan 2023 00:18:26 -0600 Subject: Finish the XML documentation in WixToolset.Mba.Core. 4623 --- src/api/burn/WixToolset.Mba.Core/Engine.cs | 83 ------------------------------ 1 file changed, 83 deletions(-) (limited to 'src/api/burn/WixToolset.Mba.Core/Engine.cs') diff --git a/src/api/burn/WixToolset.Mba.Core/Engine.cs b/src/api/burn/WixToolset.Mba.Core/Engine.cs index 3ff693c0..1120fb1c 100644 --- a/src/api/burn/WixToolset.Mba.Core/Engine.cs +++ b/src/api/burn/WixToolset.Mba.Core/Engine.cs @@ -6,21 +6,14 @@ namespace WixToolset.Mba.Core using System.ComponentModel; using System.Runtime.InteropServices; using System.Security; - using System.Text; /// /// Default implementation of . /// public sealed class Engine : IEngine { - private static readonly string normalizeVersionFormatString = "{0} must be less than or equal to " + UInt16.MaxValue; - private IBootstrapperEngine engine; - /// - /// Creates a new instance of the container class. - /// - /// The to contain. internal Engine(IBootstrapperEngine engine) { this.engine = engine; @@ -352,81 +345,5 @@ namespace WixToolset.Mba.Core { this.engine.Quit(exitCode); } - - /// - /// Utility method for converting a into a . - /// - /// - /// - public static long VersionToLong(Version version) - { - // In Windows, each version component has a max value of 65535, - // so we truncate the version before shifting it, which will overflow if invalid. - long major = (long)(ushort)version.Major << 48; - long minor = (long)(ushort)version.Minor << 32; - long build = (long)(ushort)version.Build << 16; - long revision = (long)(ushort)version.Revision; - - return major | minor | build | revision; - } - - /// - /// Utility method for converting a into a . - /// - /// - /// - public static Version LongToVersion(long version) - { - int major = (int)((version & ((long)0xffff << 48)) >> 48); - int minor = (int)((version & ((long)0xffff << 32)) >> 32); - int build = (int)((version & ((long)0xffff << 16)) >> 16); - int revision = (int)(version & 0xffff); - - return new Version(major, minor, build, revision); - } - - /// - /// Verifies that Version can be represented in a . - /// If the Build or Revision fields are undefined, they are set to zero. - /// - public static Version NormalizeVersion(Version version) - { - if (version == null) - { - throw new ArgumentNullException("version"); - } - - int major = version.Major; - int minor = version.Minor; - int build = version.Build; - int revision = version.Revision; - - if (major > UInt16.MaxValue) - { - throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Major")); - } - if (minor > UInt16.MaxValue) - { - throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Minor")); - } - if (build > UInt16.MaxValue) - { - throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Build")); - } - if (build == -1) - { - build = 0; - } - if (revision > UInt16.MaxValue) - { - throw new ArgumentOutOfRangeException("version", String.Format(normalizeVersionFormatString, "Revision")); - } - if (revision == -1) - { - revision = 0; - } - - return new Version(major, minor, build, revision); - } } } -- cgit v1.2.3-55-g6feb