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