main
cs 60 lines 1.97 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 WixRelatedBundle = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.WixRelatedBundle,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixRelatedBundleSymbolFields.BundleId), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixRelatedBundleSymbolFields.Action), IntermediateFieldType.Number),
15 },
16 typeof(WixRelatedBundleSymbol));
17 }
18 }
19
20 namespace WixToolset.Data.Symbols
21 {
22 public enum WixRelatedBundleSymbolFields
23 {
24 BundleId,
25 Action,
26 }
27
28 public enum RelatedBundleActionType
29 {
30 Detect,
31 Upgrade,
32 Addon,
33 Patch
34 }
35
36 public class WixRelatedBundleSymbol : IntermediateSymbol
37 {
38 public WixRelatedBundleSymbol() : base(SymbolDefinitions.WixRelatedBundle, null, null)
39 {
40 }
41
42 public WixRelatedBundleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixRelatedBundle, sourceLineNumber, id)
43 {
44 }
45
46 public IntermediateField this[WixRelatedBundleSymbolFields index] => this.Fields[(int)index];
47
48 public string BundleId
49 {
50 get => (string)this.Fields[(int)WixRelatedBundleSymbolFields.BundleId];
51 set => this.Set((int)WixRelatedBundleSymbolFields.BundleId, value);
52 }
53
54 public RelatedBundleActionType Action
55 {
56 get => (RelatedBundleActionType)this.Fields[(int)WixRelatedBundleSymbolFields.Action].AsNumber();
57 set => this.Set((int)WixRelatedBundleSymbolFields.Action, (int)value);
58 }
59 }
60 }