main
cs 71 lines 2.59 KB
Raw
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 WixGroup = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.WixGroup,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentId), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ParentType), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildId), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(WixGroupSymbolFields.ChildType), IntermediateFieldType.Number),
17 },
18 typeof(WixGroupSymbol));
19 }
20 }
21
22 namespace WixToolset.Data.Symbols
23 {
24 using System.Diagnostics;
25
26 public enum WixGroupSymbolFields
27 {
28 ParentId,
29 ParentType,
30 ChildId,
31 ChildType,
32 }
33
34 [DebuggerDisplay("WixGroupSymbol {ParentType} {ParentId,nq} -> {ChildType} {ChildId,nq}")]
35 public class WixGroupSymbol : IntermediateSymbol
36 {
37 public WixGroupSymbol() : base(SymbolDefinitions.WixGroup, null, null)
38 {
39 }
40
41 public WixGroupSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixGroup, sourceLineNumber, id)
42 {
43 }
44
45 public IntermediateField this[WixGroupSymbolFields index] => this.Fields[(int)index];
46
47 public string ParentId
48 {
49 get => (string)this.Fields[(int)WixGroupSymbolFields.ParentId];
50 set => this.Set((int)WixGroupSymbolFields.ParentId, value);
51 }
52
53 public ComplexReferenceParentType ParentType
54 {
55 get => (ComplexReferenceParentType)this.Fields[(int)WixGroupSymbolFields.ParentType].AsNumber();
56 set => this.Set((int)WixGroupSymbolFields.ParentType, (int)value);
57 }
58
59 public string ChildId
60 {
61 get => (string)this.Fields[(int)WixGroupSymbolFields.ChildId];
62 set => this.Set((int)WixGroupSymbolFields.ChildId, value);
63 }
64
65 public ComplexReferenceChildType ChildType
66 {
67 get => (ComplexReferenceChildType)this.Fields[(int)WixGroupSymbolFields.ChildType].AsNumber();
68 set => this.Set((int)WixGroupSymbolFields.ChildType, (int)value);
69 }
70 }
71 }