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/IniFileTuple.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/IniFileTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/IniFileTuple.cs | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/IniFileTuple.cs b/src/WixToolset.Data/Tuples/IniFileTuple.cs new file mode 100644 index 00000000..29fb3264 --- /dev/null +++ b/src/WixToolset.Data/Tuples/IniFileTuple.cs | |||
| @@ -0,0 +1,100 @@ | |||
| 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 IniFile = new IntermediateTupleDefinition( | ||
| 10 | TupleDefinitionType.IniFile, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.IniFile), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.FileName), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.DirProperty), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.Section), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.Key), IntermediateFieldType.String), | ||
| 18 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.Value), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.Action), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(IniFileTupleFields.Component_), IntermediateFieldType.String), | ||
| 21 | }, | ||
| 22 | typeof(IniFileTuple)); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | namespace WixToolset.Data.Tuples | ||
| 27 | { | ||
| 28 | public enum IniFileTupleFields | ||
| 29 | { | ||
| 30 | IniFile, | ||
| 31 | FileName, | ||
| 32 | DirProperty, | ||
| 33 | Section, | ||
| 34 | Key, | ||
| 35 | Value, | ||
| 36 | Action, | ||
| 37 | Component_, | ||
| 38 | } | ||
| 39 | |||
| 40 | public class IniFileTuple : IntermediateTuple | ||
| 41 | { | ||
| 42 | public IniFileTuple() : base(TupleDefinitions.IniFile, null, null) | ||
| 43 | { | ||
| 44 | } | ||
| 45 | |||
| 46 | public IniFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.IniFile, sourceLineNumber, id) | ||
| 47 | { | ||
| 48 | } | ||
| 49 | |||
| 50 | public IntermediateField this[IniFileTupleFields index] => this.Fields[(int)index]; | ||
| 51 | |||
| 52 | public string IniFile | ||
| 53 | { | ||
| 54 | get => (string)this.Fields[(int)IniFileTupleFields.IniFile]?.Value; | ||
| 55 | set => this.Set((int)IniFileTupleFields.IniFile, value); | ||
| 56 | } | ||
| 57 | |||
| 58 | public string FileName | ||
| 59 | { | ||
| 60 | get => (string)this.Fields[(int)IniFileTupleFields.FileName]?.Value; | ||
| 61 | set => this.Set((int)IniFileTupleFields.FileName, value); | ||
| 62 | } | ||
| 63 | |||
| 64 | public string DirProperty | ||
| 65 | { | ||
| 66 | get => (string)this.Fields[(int)IniFileTupleFields.DirProperty]?.Value; | ||
| 67 | set => this.Set((int)IniFileTupleFields.DirProperty, value); | ||
| 68 | } | ||
| 69 | |||
| 70 | public string Section | ||
| 71 | { | ||
| 72 | get => (string)this.Fields[(int)IniFileTupleFields.Section]?.Value; | ||
| 73 | set => this.Set((int)IniFileTupleFields.Section, value); | ||
| 74 | } | ||
| 75 | |||
| 76 | public string Key | ||
| 77 | { | ||
| 78 | get => (string)this.Fields[(int)IniFileTupleFields.Key]?.Value; | ||
| 79 | set => this.Set((int)IniFileTupleFields.Key, value); | ||
| 80 | } | ||
| 81 | |||
| 82 | public string Value | ||
| 83 | { | ||
| 84 | get => (string)this.Fields[(int)IniFileTupleFields.Value]?.Value; | ||
| 85 | set => this.Set((int)IniFileTupleFields.Value, value); | ||
| 86 | } | ||
| 87 | |||
| 88 | public int Action | ||
| 89 | { | ||
| 90 | get => (int)this.Fields[(int)IniFileTupleFields.Action]?.Value; | ||
| 91 | set => this.Set((int)IniFileTupleFields.Action, value); | ||
| 92 | } | ||
| 93 | |||
| 94 | public string Component_ | ||
| 95 | { | ||
| 96 | get => (string)this.Fields[(int)IniFileTupleFields.Component_]?.Value; | ||
| 97 | set => this.Set((int)IniFileTupleFields.Component_, value); | ||
| 98 | } | ||
| 99 | } | ||
| 100 | } \ No newline at end of file | ||
