diff options
Diffstat (limited to '')
-rw-r--r-- | src/WixToolset.Data/Tuples/WixGroupTuple.cs | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/WixGroupTuple.cs b/src/WixToolset.Data/Tuples/WixGroupTuple.cs new file mode 100644 index 00000000..be6bf7a4 --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixGroupTuple.cs | |||
@@ -0,0 +1,70 @@ | |||
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 WixGroup = new IntermediateTupleDefinition( | ||
10 | TupleDefinitionType.WixGroup, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(WixGroupTupleFields.ParentId), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(WixGroupTupleFields.ParentType), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(WixGroupTupleFields.ChildId), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(WixGroupTupleFields.ChildType), IntermediateFieldType.String), | ||
17 | }, | ||
18 | typeof(WixGroupTuple)); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | namespace WixToolset.Data.Tuples | ||
23 | { | ||
24 | using System; | ||
25 | |||
26 | public enum WixGroupTupleFields | ||
27 | { | ||
28 | ParentId, | ||
29 | ParentType, | ||
30 | ChildId, | ||
31 | ChildType, | ||
32 | } | ||
33 | |||
34 | public class WixGroupTuple : IntermediateTuple | ||
35 | { | ||
36 | public WixGroupTuple() : base(TupleDefinitions.WixGroup, null, null) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | public WixGroupTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixGroup, sourceLineNumber, id) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | public IntermediateField this[WixGroupTupleFields index] => this.Fields[(int)index]; | ||
45 | |||
46 | public string ParentId | ||
47 | { | ||
48 | get => (string)this.Fields[(int)WixGroupTupleFields.ParentId]?.Value; | ||
49 | set => this.Set((int)WixGroupTupleFields.ParentId, value); | ||
50 | } | ||
51 | |||
52 | public ComplexReferenceParentType ParentType | ||
53 | { | ||
54 | get => (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), (string)this.Fields[(int)WixGroupTupleFields.ParentType]?.Value, true); | ||
55 | set => this.Set((int)WixGroupTupleFields.ParentType, value.ToString()); | ||
56 | } | ||
57 | |||
58 | public string ChildId | ||
59 | { | ||
60 | get => (string)this.Fields[(int)WixGroupTupleFields.ChildId]?.Value; | ||
61 | set => this.Set((int)WixGroupTupleFields.ChildId, value); | ||
62 | } | ||
63 | |||
64 | public ComplexReferenceChildType ChildType | ||
65 | { | ||
66 | get => (ComplexReferenceChildType)Enum.Parse(typeof(ComplexReferenceChildType), (string)this.Fields[(int)WixGroupTupleFields.ChildType]?.Value, true); | ||
67 | set => this.Set((int)WixGroupTupleFields.ChildType, value.ToString()); | ||
68 | } | ||
69 | } | ||
70 | } \ No newline at end of file | ||