| 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 UserGroup = new IntermediateSymbolDefinition( |
| 11 | UtilSymbolDefinitionType.UserGroup.ToString(), |
| 12 | new[] |
| 13 | { |
| 14 | new IntermediateFieldDefinition(nameof(UserGroupSymbolFields.UserRef), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(UserGroupSymbolFields.GroupRef), IntermediateFieldType.String), |
| 16 | }, |
| 17 | typeof(UserGroupSymbol)); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | namespace WixToolset.Util.Symbols |
| 22 | { |
| 23 | using WixToolset.Data; |
| 24 | |
| 25 | public enum UserGroupSymbolFields |
| 26 | { |
| 27 | UserRef, |
| 28 | GroupRef, |
| 29 | } |
| 30 | |
| 31 | public class UserGroupSymbol : IntermediateSymbol |
| 32 | { |
| 33 | public UserGroupSymbol() : base(UtilSymbolDefinitions.UserGroup, null, null) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | public UserGroupSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilSymbolDefinitions.UserGroup, sourceLineNumber, id) |
| 38 | { |
| 39 | } |
| 40 | |
| 41 | public IntermediateField this[UserGroupSymbolFields index] => this.Fields[(int)index]; |
| 42 | |
| 43 | public string UserRef |
| 44 | { |
| 45 | get => this.Fields[(int)UserGroupSymbolFields.UserRef].AsString(); |
| 46 | set => this.Set((int)UserGroupSymbolFields.UserRef, value); |
| 47 | } |
| 48 | |
| 49 | public string GroupRef |
| 50 | { |
| 51 | get => this.Fields[(int)UserGroupSymbolFields.GroupRef].AsString(); |
| 52 | set => this.Set((int)UserGroupSymbolFields.GroupRef, value); |
| 53 | } |
| 54 | } |
| 55 | } |