From a790cb2da9600562e2622eb074274b0d69257484 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 27 Jun 2020 12:08:02 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- src/wixext/Symbols/DifxAppSymbolDefinitions.cs | 39 ++++++++++++++++ src/wixext/Symbols/MsiDriverPackagesSymbol.cs | 63 ++++++++++++++++++++++++++ src/wixext/Tuples/DifxAppTupleDefinitions.cs | 39 ---------------- src/wixext/Tuples/MsiDriverPackagesTuple.cs | 63 -------------------------- 4 files changed, 102 insertions(+), 102 deletions(-) create mode 100644 src/wixext/Symbols/DifxAppSymbolDefinitions.cs create mode 100644 src/wixext/Symbols/MsiDriverPackagesSymbol.cs delete mode 100644 src/wixext/Tuples/DifxAppTupleDefinitions.cs delete mode 100644 src/wixext/Tuples/MsiDriverPackagesTuple.cs diff --git a/src/wixext/Symbols/DifxAppSymbolDefinitions.cs b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs new file mode 100644 index 00000000..76f4d88f --- /dev/null +++ b/src/wixext/Symbols/DifxAppSymbolDefinitions.cs @@ -0,0 +1,39 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using System; + using WixToolset.Data; + + public enum DifxAppSymbolDefinitionType + { + MsiDriverPackages, + } + + public static partial class DifxAppSymbolDefinitions + { + public static readonly Version Version = new Version("4.0.0"); + + public static IntermediateSymbolDefinition ByName(string name) + { + if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) + { + return null; + } + + return ByType(type); + } + + public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) + { + switch (type) + { + case DifxAppSymbolDefinitionType.MsiDriverPackages: + return DifxAppSymbolDefinitions.MsiDriverPackages; + + default: + throw new ArgumentOutOfRangeException(nameof(type)); + } + } + } +} diff --git a/src/wixext/Symbols/MsiDriverPackagesSymbol.cs b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs new file mode 100644 index 00000000..2fd91bc8 --- /dev/null +++ b/src/wixext/Symbols/MsiDriverPackagesSymbol.cs @@ -0,0 +1,63 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.DifxApp +{ + using WixToolset.Data; + using WixToolset.DifxApp.Symbols; + + public static partial class DifxAppSymbolDefinitions + { + public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( + DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), + }, + typeof(MsiDriverPackagesSymbol)); + } +} + +namespace WixToolset.DifxApp.Symbols +{ + using WixToolset.Data; + + public enum MsiDriverPackagesSymbolFields + { + ComponentRef, + Flags, + Sequence, + } + + public class MsiDriverPackagesSymbol : IntermediateSymbol + { + public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) + { + } + + public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) + { + } + + public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; + + public string ComponentRef + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); + set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); + } + + public int Flags + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); + } + + public int? Sequence + { + get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); + set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); + } + } +} \ No newline at end of file diff --git a/src/wixext/Tuples/DifxAppTupleDefinitions.cs b/src/wixext/Tuples/DifxAppTupleDefinitions.cs deleted file mode 100644 index 76f4d88f..00000000 --- a/src/wixext/Tuples/DifxAppTupleDefinitions.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using System; - using WixToolset.Data; - - public enum DifxAppSymbolDefinitionType - { - MsiDriverPackages, - } - - public static partial class DifxAppSymbolDefinitions - { - public static readonly Version Version = new Version("4.0.0"); - - public static IntermediateSymbolDefinition ByName(string name) - { - if (!Enum.TryParse(name, out DifxAppSymbolDefinitionType type)) - { - return null; - } - - return ByType(type); - } - - public static IntermediateSymbolDefinition ByType(DifxAppSymbolDefinitionType type) - { - switch (type) - { - case DifxAppSymbolDefinitionType.MsiDriverPackages: - return DifxAppSymbolDefinitions.MsiDriverPackages; - - default: - throw new ArgumentOutOfRangeException(nameof(type)); - } - } - } -} diff --git a/src/wixext/Tuples/MsiDriverPackagesTuple.cs b/src/wixext/Tuples/MsiDriverPackagesTuple.cs deleted file mode 100644 index 2fd91bc8..00000000 --- a/src/wixext/Tuples/MsiDriverPackagesTuple.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.DifxApp -{ - using WixToolset.Data; - using WixToolset.DifxApp.Symbols; - - public static partial class DifxAppSymbolDefinitions - { - public static readonly IntermediateSymbolDefinition MsiDriverPackages = new IntermediateSymbolDefinition( - DifxAppSymbolDefinitionType.MsiDriverPackages.ToString(), - new[] - { - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.ComponentRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Flags), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(MsiDriverPackagesSymbolFields.Sequence), IntermediateFieldType.Number), - }, - typeof(MsiDriverPackagesSymbol)); - } -} - -namespace WixToolset.DifxApp.Symbols -{ - using WixToolset.Data; - - public enum MsiDriverPackagesSymbolFields - { - ComponentRef, - Flags, - Sequence, - } - - public class MsiDriverPackagesSymbol : IntermediateSymbol - { - public MsiDriverPackagesSymbol() : base(DifxAppSymbolDefinitions.MsiDriverPackages, null, null) - { - } - - public MsiDriverPackagesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(DifxAppSymbolDefinitions.MsiDriverPackages, sourceLineNumber, id) - { - } - - public IntermediateField this[MsiDriverPackagesSymbolFields index] => this.Fields[(int)index]; - - public string ComponentRef - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.ComponentRef].AsString(); - set => this.Set((int)MsiDriverPackagesSymbolFields.ComponentRef, value); - } - - public int Flags - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Flags].AsNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Flags, value); - } - - public int? Sequence - { - get => this.Fields[(int)MsiDriverPackagesSymbolFields.Sequence].AsNullableNumber(); - set => this.Set((int)MsiDriverPackagesSymbolFields.Sequence, value); - } - } -} \ No newline at end of file -- cgit v1.2.3-55-g6feb