aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs')
-rw-r--r--src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs
new file mode 100644
index 00000000..0490f9f7
--- /dev/null
+++ b/src/WixToolset.Data/Symbols/WixBundleCustomDataSymbol.cs
@@ -0,0 +1,71 @@
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
3namespace 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.BundleExtensionRef), IntermediateFieldType.String),
16 },
17 typeof(WixBundleCustomDataSymbol));
18 }
19}
20
21namespace WixToolset.Data.Symbols
22{
23 public enum WixBundleCustomDataSymbolFields
24 {
25 AttributeNames,
26 Type,
27 BundleExtensionRef,
28 }
29
30 public enum WixBundleCustomDataType
31 {
32 Unknown,
33 BootstrapperApplication,
34 BundleExtension,
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 BundleExtensionRef
64 {
65 get => (string)this.Fields[(int)WixBundleCustomDataSymbolFields.BundleExtensionRef];
66 set => this.Set((int)WixBundleCustomDataSymbolFields.BundleExtensionRef, value);
67 }
68
69 public string[] AttributeNamesSeparated => this.AttributeNames.Split(AttributeNamesSeparator);
70 }
71}