From 70bf83df639289f550ddba22c9e8c85208fb188f Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 27 Mar 2020 10:35:53 +1000 Subject: Add WixSetVariableTuple. --- src/WixToolset.Data/Tuples/TupleDefinitions.cs | 4 ++ src/WixToolset.Data/Tuples/WixSetVariableTuple.cs | 52 +++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 src/WixToolset.Data/Tuples/WixSetVariableTuple.cs diff --git a/src/WixToolset.Data/Tuples/TupleDefinitions.cs b/src/WixToolset.Data/Tuples/TupleDefinitions.cs index 2bec2d01..78da0da3 100644 --- a/src/WixToolset.Data/Tuples/TupleDefinitions.cs +++ b/src/WixToolset.Data/Tuples/TupleDefinitions.cs @@ -185,6 +185,7 @@ namespace WixToolset.Data WixRelatedBundle, WixSearch, WixSearchRelation, + WixSetVariable, WixSimpleReference, WixSuppressAction, WixSuppressModularization, @@ -737,6 +738,9 @@ namespace WixToolset.Data case TupleDefinitionType.WixSearchRelation: return TupleDefinitions.WixSearchRelation; + case TupleDefinitionType.WixSetVariable: + return TupleDefinitions.WixSetVariable; + case TupleDefinitionType.WixSimpleReference: return TupleDefinitions.WixSimpleReference; diff --git a/src/WixToolset.Data/Tuples/WixSetVariableTuple.cs b/src/WixToolset.Data/Tuples/WixSetVariableTuple.cs new file mode 100644 index 00000000..6c1e9908 --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixSetVariableTuple.cs @@ -0,0 +1,52 @@ +// 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.Tuples; + + public static partial class TupleDefinitions + { + public static readonly IntermediateTupleDefinition WixSetVariable = new IntermediateTupleDefinition( + TupleDefinitionType.WixSetVariable, + new[] + { + new IntermediateFieldDefinition(nameof(WixSetVariableTupleFields.Value), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixSetVariableTupleFields.Type), IntermediateFieldType.String), + }, + typeof(WixSetVariableTuple)); + } +} + +namespace WixToolset.Data.Tuples +{ + public enum WixSetVariableTupleFields + { + Value, + Type, + } + + public class WixSetVariableTuple : IntermediateTuple + { + public WixSetVariableTuple() : base(TupleDefinitions.WixSetVariable, null, null) + { + } + + public WixSetVariableTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixSetVariable, sourceLineNumber, id) + { + } + + public IntermediateField this[WixSetVariableTupleFields index] => this.Fields[(int)index]; + + public string Value + { + get => (string)this.Fields[(int)WixSetVariableTupleFields.Value]; + set => this.Set((int)WixSetVariableTupleFields.Value, value); + } + + public string Type + { + get => (string)this.Fields[(int)WixSetVariableTupleFields.Type]; + set => this.Set((int)WixSetVariableTupleFields.Type, value); + } + } +} -- cgit v1.2.3-55-g6feb