From d87492c97b5ac6eec1c86c4cc8b2b45e9f8ad165 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 24 Jun 2020 14:41:52 -0700 Subject: The Great Tuple to Symbol File Rename (tm) --- .../Symbols/WixBundlePatchTargetCodeSymbol.cs | 82 ++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs (limited to 'src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs') diff --git a/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs b/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs new file mode 100644 index 00000000..b1aa9c77 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs @@ -0,0 +1,82 @@ +// 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.Data +{ + using WixToolset.Data.Symbols; + + public static partial class SymbolDefinitions + { + public static readonly IntermediateSymbolDefinition WixBundlePatchTargetCode = new IntermediateSymbolDefinition( + SymbolDefinitionType.WixBundlePatchTargetCode, + new[] + { + new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.PackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.TargetCode), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.Attributes), IntermediateFieldType.Number), + }, + typeof(WixBundlePatchTargetCodeSymbol)); + } +} + +namespace WixToolset.Data.Symbols +{ + using System; + + public enum WixBundlePatchTargetCodeSymbolFields + { + PackageRef, + TargetCode, + Attributes, + } + + [Flags] + public enum WixBundlePatchTargetCodeAttributes : int + { + None = 0, + + /// + /// The transform targets a specific ProductCode. + /// + TargetsProductCode = 1, + + /// + /// The transform targets a specific UpgradeCode. + /// + TargetsUpgradeCode = 2, + } + + public class WixBundlePatchTargetCodeSymbol : IntermediateSymbol + { + public WixBundlePatchTargetCodeSymbol() : base(SymbolDefinitions.WixBundlePatchTargetCode, null, null) + { + } + + public WixBundlePatchTargetCodeSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundlePatchTargetCode, sourceLineNumber, id) + { + } + + public IntermediateField this[WixBundlePatchTargetCodeSymbolFields index] => this.Fields[(int)index]; + + public string PackageRef + { + get => (string)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.PackageRef]; + set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.PackageRef, value); + } + + public string TargetCode + { + get => (string)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.TargetCode]; + set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.TargetCode, value); + } + + public WixBundlePatchTargetCodeAttributes Attributes + { + get => (WixBundlePatchTargetCodeAttributes)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.Attributes].AsNumber(); + set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.Attributes, (int)value); + } + + public bool TargetsProductCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsProductCode) == WixBundlePatchTargetCodeAttributes.TargetsProductCode; + + public bool TargetsUpgradeCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode) == WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode; + } +} -- cgit v1.2.3-55-g6feb