diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-03-27 10:35:53 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-03-30 21:23:16 +1000 |
commit | 70bf83df639289f550ddba22c9e8c85208fb188f (patch) | |
tree | d34d5601a66a1ea4fd4644746818a8366db6fd0e | |
parent | 66b668b4c5d37f572dfca86446f7dddc5dd3d85f (diff) | |
download | wix-70bf83df639289f550ddba22c9e8c85208fb188f.tar.gz wix-70bf83df639289f550ddba22c9e8c85208fb188f.tar.bz2 wix-70bf83df639289f550ddba22c9e8c85208fb188f.zip |
Add WixSetVariableTuple.
-rw-r--r-- | src/WixToolset.Data/Tuples/TupleDefinitions.cs | 4 | ||||
-rw-r--r-- | src/WixToolset.Data/Tuples/WixSetVariableTuple.cs | 52 |
2 files changed, 56 insertions, 0 deletions
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 | |||
185 | WixRelatedBundle, | 185 | WixRelatedBundle, |
186 | WixSearch, | 186 | WixSearch, |
187 | WixSearchRelation, | 187 | WixSearchRelation, |
188 | WixSetVariable, | ||
188 | WixSimpleReference, | 189 | WixSimpleReference, |
189 | WixSuppressAction, | 190 | WixSuppressAction, |
190 | WixSuppressModularization, | 191 | WixSuppressModularization, |
@@ -737,6 +738,9 @@ namespace WixToolset.Data | |||
737 | case TupleDefinitionType.WixSearchRelation: | 738 | case TupleDefinitionType.WixSearchRelation: |
738 | return TupleDefinitions.WixSearchRelation; | 739 | return TupleDefinitions.WixSearchRelation; |
739 | 740 | ||
741 | case TupleDefinitionType.WixSetVariable: | ||
742 | return TupleDefinitions.WixSetVariable; | ||
743 | |||
740 | case TupleDefinitionType.WixSimpleReference: | 744 | case TupleDefinitionType.WixSimpleReference: |
741 | return TupleDefinitions.WixSimpleReference; | 745 | return TupleDefinitions.WixSimpleReference; |
742 | 746 | ||
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 @@ | |||
1 | // 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. | ||
2 | |||
3 | namespace WixToolset.Data | ||
4 | { | ||
5 | using WixToolset.Data.Tuples; | ||
6 | |||
7 | public static partial class TupleDefinitions | ||
8 | { | ||
9 | public static readonly IntermediateTupleDefinition WixSetVariable = new IntermediateTupleDefinition( | ||
10 | TupleDefinitionType.WixSetVariable, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(WixSetVariableTupleFields.Value), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(WixSetVariableTupleFields.Type), IntermediateFieldType.String), | ||
15 | }, | ||
16 | typeof(WixSetVariableTuple)); | ||
17 | } | ||
18 | } | ||
19 | |||
20 | namespace WixToolset.Data.Tuples | ||
21 | { | ||
22 | public enum WixSetVariableTupleFields | ||
23 | { | ||
24 | Value, | ||
25 | Type, | ||
26 | } | ||
27 | |||
28 | public class WixSetVariableTuple : IntermediateTuple | ||
29 | { | ||
30 | public WixSetVariableTuple() : base(TupleDefinitions.WixSetVariable, null, null) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | public WixSetVariableTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixSetVariable, sourceLineNumber, id) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | public IntermediateField this[WixSetVariableTupleFields index] => this.Fields[(int)index]; | ||
39 | |||
40 | public string Value | ||
41 | { | ||
42 | get => (string)this.Fields[(int)WixSetVariableTupleFields.Value]; | ||
43 | set => this.Set((int)WixSetVariableTupleFields.Value, value); | ||
44 | } | ||
45 | |||
46 | public string Type | ||
47 | { | ||
48 | get => (string)this.Fields[(int)WixSetVariableTupleFields.Type]; | ||
49 | set => this.Set((int)WixSetVariableTupleFields.Type, value); | ||
50 | } | ||
51 | } | ||
52 | } | ||