aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/IniLocatorTuple.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Tuples/IniLocatorTuple.cs')
-rw-r--r--src/WixToolset.Data/Tuples/IniLocatorTuple.cs84
1 files changed, 84 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/IniLocatorTuple.cs b/src/WixToolset.Data/Tuples/IniLocatorTuple.cs
new file mode 100644
index 00000000..f956ee5f
--- /dev/null
+++ b/src/WixToolset.Data/Tuples/IniLocatorTuple.cs
@@ -0,0 +1,84 @@
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
3namespace WixToolset.Data
4{
5 using WixToolset.Data.Tuples;
6
7 public static partial class TupleDefinitions
8 {
9 public static readonly IntermediateTupleDefinition IniLocator = new IntermediateTupleDefinition(
10 TupleDefinitionType.IniLocator,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.Signature_), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.FileName), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.Section), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.Key), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.Field), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(IniLocatorTupleFields.Type), IntermediateFieldType.Number),
19 },
20 typeof(IniLocatorTuple));
21 }
22}
23
24namespace WixToolset.Data.Tuples
25{
26 public enum IniLocatorTupleFields
27 {
28 Signature_,
29 FileName,
30 Section,
31 Key,
32 Field,
33 Type,
34 }
35
36 public class IniLocatorTuple : IntermediateTuple
37 {
38 public IniLocatorTuple() : base(TupleDefinitions.IniLocator, null, null)
39 {
40 }
41
42 public IniLocatorTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.IniLocator, sourceLineNumber, id)
43 {
44 }
45
46 public IntermediateField this[IniLocatorTupleFields index] => this.Fields[(int)index];
47
48 public string Signature_
49 {
50 get => (string)this.Fields[(int)IniLocatorTupleFields.Signature_]?.Value;
51 set => this.Set((int)IniLocatorTupleFields.Signature_, value);
52 }
53
54 public string FileName
55 {
56 get => (string)this.Fields[(int)IniLocatorTupleFields.FileName]?.Value;
57 set => this.Set((int)IniLocatorTupleFields.FileName, value);
58 }
59
60 public string Section
61 {
62 get => (string)this.Fields[(int)IniLocatorTupleFields.Section]?.Value;
63 set => this.Set((int)IniLocatorTupleFields.Section, value);
64 }
65
66 public string Key
67 {
68 get => (string)this.Fields[(int)IniLocatorTupleFields.Key]?.Value;
69 set => this.Set((int)IniLocatorTupleFields.Key, value);
70 }
71
72 public int Field
73 {
74 get => (int)this.Fields[(int)IniLocatorTupleFields.Field]?.Value;
75 set => this.Set((int)IniLocatorTupleFields.Field, value);
76 }
77
78 public int Type
79 {
80 get => (int)this.Fields[(int)IniLocatorTupleFields.Type]?.Value;
81 set => this.Set((int)IniLocatorTupleFields.Type, value);
82 }
83 }
84} \ No newline at end of file