| 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.Util |
| 4 | { |
| 5 | using WixToolset.Data; |
| 6 | using WixToolset.Util.Symbols; |
| 7 | |
| 8 | public static partial class UtilSymbolDefinitions |
| 9 | { |
| 10 | public static readonly IntermediateSymbolDefinition Group = new IntermediateSymbolDefinition( |
| 11 | UtilSymbolDefinitionType.Group.ToString(), |
| 12 | new[] |
| 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(GroupSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(GroupSymbolFields.Name), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(GroupSymbolFields.Domain), IntermediateFieldType.String), |
| 17 | }, |
| 18 | typeof(GroupSymbol)); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | namespace WixToolset.Util.Symbols |
| 23 | { |
| 24 | using WixToolset.Data; |
| 25 | |
| 26 | public enum GroupSymbolFields |
| 27 | { |
| 28 | ComponentRef, |
| 29 | Name, |
| 30 | Domain, |
| 31 | } |
| 32 | |
| 33 | public class GroupSymbol : IntermediateSymbol |
| 34 | { |
| 35 | public GroupSymbol() : base(UtilSymbolDefinitions.Group, null, null) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | public GroupSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.Group, sourceLineNumber, id) |
| 40 | { |
| 41 | } |
| 42 | |
| 43 | public IntermediateField this[GroupSymbolFields index] => this.Fields[(int)index]; |
| 44 | |
| 45 | public string ComponentRef |
| 46 | { |
| 47 | get => this.Fields[(int)GroupSymbolFields.ComponentRef].AsString(); |
| 48 | set => this.Set((int)GroupSymbolFields.ComponentRef, value); |
| 49 | } |
| 50 | |
| 51 | public string Name |
| 52 | { |
| 53 | get => this.Fields[(int)GroupSymbolFields.Name].AsString(); |
| 54 | set => this.Set((int)GroupSymbolFields.Name, value); |
| 55 | } |
| 56 | |
| 57 | public string Domain |
| 58 | { |
| 59 | get => this.Fields[(int)GroupSymbolFields.Domain].AsString(); |
| 60 | set => this.Set((int)GroupSymbolFields.Domain, value); |
| 61 | } |
| 62 | } |
| 63 | } |