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