diff options
Diffstat (limited to 'src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs')
-rw-r--r-- | src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs b/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs new file mode 100644 index 00000000..89365605 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixComplexReferenceSymbol.cs | |||
@@ -0,0 +1,86 @@ | |||
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.Symbols; | ||
6 | |||
7 | public static partial class SymbolDefinitions | ||
8 | { | ||
9 | public static readonly IntermediateSymbolDefinition WixComplexReference = new IntermediateSymbolDefinition( | ||
10 | SymbolDefinitionType.WixComplexReference, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Parent), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentAttributes), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ParentLanguage), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Child), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.ChildAttributes), IntermediateFieldType.String), | ||
18 | new IntermediateFieldDefinition(nameof(WixComplexReferenceSymbolFields.Attributes), IntermediateFieldType.Bool), | ||
19 | }, | ||
20 | typeof(WixComplexReferenceSymbol)); | ||
21 | } | ||
22 | } | ||
23 | |||
24 | namespace WixToolset.Data.Symbols | ||
25 | { | ||
26 | using System; | ||
27 | |||
28 | public enum WixComplexReferenceSymbolFields | ||
29 | { | ||
30 | Parent, | ||
31 | ParentAttributes, | ||
32 | ParentLanguage, | ||
33 | Child, | ||
34 | ChildAttributes, | ||
35 | Attributes, | ||
36 | } | ||
37 | |||
38 | public class WixComplexReferenceSymbol : IntermediateSymbol | ||
39 | { | ||
40 | public WixComplexReferenceSymbol() : base(SymbolDefinitions.WixComplexReference, null, null) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | public WixComplexReferenceSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixComplexReference, sourceLineNumber, id) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | public IntermediateField this[WixComplexReferenceSymbolFields index] => this.Fields[(int)index]; | ||
49 | |||
50 | public string Parent | ||
51 | { | ||
52 | get => (string)this.Fields[(int)WixComplexReferenceSymbolFields.Parent]; | ||
53 | set => this.Set((int)WixComplexReferenceSymbolFields.Parent, value); | ||
54 | } | ||
55 | |||
56 | public ComplexReferenceParentType ParentType | ||
57 | { | ||
58 | get => (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), (string)this.Fields[(int)WixComplexReferenceSymbolFields.ParentAttributes], true); | ||
59 | set => this.Set((int)WixComplexReferenceSymbolFields.ParentAttributes, value.ToString()); | ||
60 | } | ||
61 | |||
62 | public string ParentLanguage | ||
63 | { | ||
64 | get => (string)this.Fields[(int)WixComplexReferenceSymbolFields.ParentLanguage]; | ||
65 | set => this.Set((int)WixComplexReferenceSymbolFields.ParentLanguage, value); | ||
66 | } | ||
67 | |||
68 | public string Child | ||
69 | { | ||
70 | get => (string)this.Fields[(int)WixComplexReferenceSymbolFields.Child]; | ||
71 | set => this.Set((int)WixComplexReferenceSymbolFields.Child, value); | ||
72 | } | ||
73 | |||
74 | public ComplexReferenceChildType ChildType | ||
75 | { | ||
76 | get => (ComplexReferenceChildType)Enum.Parse(typeof(ComplexReferenceChildType), (string)this.Fields[(int)WixComplexReferenceSymbolFields.ChildAttributes], true); | ||
77 | set => this.Set((int)WixComplexReferenceSymbolFields.ChildAttributes, value.ToString()); | ||
78 | } | ||
79 | |||
80 | public bool IsPrimary | ||
81 | { | ||
82 | get => (bool)this.Fields[(int)WixComplexReferenceSymbolFields.Attributes]; | ||
83 | set => this.Set((int)WixComplexReferenceSymbolFields.Attributes, value); | ||
84 | } | ||
85 | } | ||
86 | } \ No newline at end of file | ||