diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
| commit | 69b15d96cebdbb7201b1849b4f62786633d70b8d (patch) | |
| tree | 4b65de8679e4b4ab81b69edcccbac1ae9f55a16d /src/WixToolset.Data/Tuples/EnvironmentTuple.cs | |
| parent | a8656a87887d6cb2c54f4bbeacee37f7074f1032 (diff) | |
| download | wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.gz wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.bz2 wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.zip | |
Introduce WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data/Tuples/EnvironmentTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/EnvironmentTuple.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/EnvironmentTuple.cs b/src/WixToolset.Data/Tuples/EnvironmentTuple.cs new file mode 100644 index 00000000..9ee05a19 --- /dev/null +++ b/src/WixToolset.Data/Tuples/EnvironmentTuple.cs | |||
| @@ -0,0 +1,68 @@ | |||
| 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 Environment = new IntermediateTupleDefinition( | ||
| 10 | TupleDefinitionType.Environment, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Environment), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Name), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Value), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Component_), IntermediateFieldType.String), | ||
| 17 | }, | ||
| 18 | typeof(EnvironmentTuple)); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | namespace WixToolset.Data.Tuples | ||
| 23 | { | ||
| 24 | public enum EnvironmentTupleFields | ||
| 25 | { | ||
| 26 | Environment, | ||
| 27 | Name, | ||
| 28 | Value, | ||
| 29 | Component_, | ||
| 30 | } | ||
| 31 | |||
| 32 | public class EnvironmentTuple : IntermediateTuple | ||
| 33 | { | ||
| 34 | public EnvironmentTuple() : base(TupleDefinitions.Environment, null, null) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | |||
| 38 | public EnvironmentTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.Environment, sourceLineNumber, id) | ||
| 39 | { | ||
| 40 | } | ||
| 41 | |||
| 42 | public IntermediateField this[EnvironmentTupleFields index] => this.Fields[(int)index]; | ||
| 43 | |||
| 44 | public string Environment | ||
| 45 | { | ||
| 46 | get => (string)this.Fields[(int)EnvironmentTupleFields.Environment]?.Value; | ||
| 47 | set => this.Set((int)EnvironmentTupleFields.Environment, value); | ||
| 48 | } | ||
| 49 | |||
| 50 | public string Name | ||
| 51 | { | ||
| 52 | get => (string)this.Fields[(int)EnvironmentTupleFields.Name]?.Value; | ||
| 53 | set => this.Set((int)EnvironmentTupleFields.Name, value); | ||
| 54 | } | ||
| 55 | |||
| 56 | public string Value | ||
| 57 | { | ||
| 58 | get => (string)this.Fields[(int)EnvironmentTupleFields.Value]?.Value; | ||
| 59 | set => this.Set((int)EnvironmentTupleFields.Value, value); | ||
| 60 | } | ||
| 61 | |||
| 62 | public string Component_ | ||
| 63 | { | ||
| 64 | get => (string)this.Fields[(int)EnvironmentTupleFields.Component_]?.Value; | ||
| 65 | set => this.Set((int)EnvironmentTupleFields.Component_, value); | ||
| 66 | } | ||
| 67 | } | ||
| 68 | } \ No newline at end of file | ||
