| 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 WixBundleCustomData = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.WixBundleCustomData, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixBundleCustomDataSymbolFields.AttributeNames), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(WixBundleCustomDataSymbolFields.Type), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(WixBundleCustomDataSymbolFields.BootstrapperExtensionRef), IntermediateFieldType.String), |
| 16 | }, |
| 17 | typeof(WixBundleCustomDataSymbol)); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | namespace WixToolset.Data.Symbols |
| 22 | { |
| 23 | public enum WixBundleCustomDataSymbolFields |
| 24 | { |
| 25 | AttributeNames, |
| 26 | Type, |
| 27 | BootstrapperExtensionRef, |
| 28 | } |
| 29 | |
| 30 | public enum WixBundleCustomDataType |
| 31 | { |
| 32 | Unknown, |
| 33 | BootstrapperApplication, |
| 34 | BootstrapperExtension, |
| 35 | } |
| 36 | |
| 37 | public class WixBundleCustomDataSymbol : IntermediateSymbol |
| 38 | { |
| 39 | public const char AttributeNamesSeparator = '\x85'; |
| 40 | |
| 41 | public WixBundleCustomDataSymbol() : base(SymbolDefinitions.WixBundleCustomData, null, null) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | public WixBundleCustomDataSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleCustomData, sourceLineNumber, id) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | public IntermediateField this[WixBundleCustomDataSymbolFields index] => this.Fields[(int)index]; |
| 50 | |
| 51 | public string AttributeNames |
| 52 | { |
| 53 | get => (string)this.Fields[(int)WixBundleCustomDataSymbolFields.AttributeNames]; |
| 54 | set => this.Set((int)WixBundleCustomDataSymbolFields.AttributeNames, value); |
| 55 | } |
| 56 | |
| 57 | public WixBundleCustomDataType Type |
| 58 | { |
| 59 | get => (WixBundleCustomDataType)this.Fields[(int)WixBundleCustomDataSymbolFields.Type].AsNumber(); |
| 60 | set => this.Set((int)WixBundleCustomDataSymbolFields.Type, (int)value); |
| 61 | } |
| 62 | |
| 63 | public string BootstrapperExtensionRef |
| 64 | { |
| 65 | get => (string)this.Fields[(int)WixBundleCustomDataSymbolFields.BootstrapperExtensionRef]; |
| 66 | set => this.Set((int)WixBundleCustomDataSymbolFields.BootstrapperExtensionRef, value); |
| 67 | } |
| 68 | |
| 69 | public string[] AttributeNamesSeparated => this.AttributeNames.Split(AttributeNamesSeparator); |
| 70 | } |
| 71 | } |