aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs')
-rw-r--r--src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs b/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs
new file mode 100644
index 00000000..b1aa9c77
--- /dev/null
+++ b/src/WixToolset.Data/Symbols/WixBundlePatchTargetCodeSymbol.cs
@@ -0,0 +1,82 @@
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 WixBundlePatchTargetCode = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.WixBundlePatchTargetCode,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.PackageRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.TargetCode), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeSymbolFields.Attributes), IntermediateFieldType.Number),
16 },
17 typeof(WixBundlePatchTargetCodeSymbol));
18 }
19}
20
21namespace WixToolset.Data.Symbols
22{
23 using System;
24
25 public enum WixBundlePatchTargetCodeSymbolFields
26 {
27 PackageRef,
28 TargetCode,
29 Attributes,
30 }
31
32 [Flags]
33 public enum WixBundlePatchTargetCodeAttributes : int
34 {
35 None = 0,
36
37 /// <summary>
38 /// The transform targets a specific ProductCode.
39 /// </summary>
40 TargetsProductCode = 1,
41
42 /// <summary>
43 /// The transform targets a specific UpgradeCode.
44 /// </summary>
45 TargetsUpgradeCode = 2,
46 }
47
48 public class WixBundlePatchTargetCodeSymbol : IntermediateSymbol
49 {
50 public WixBundlePatchTargetCodeSymbol() : base(SymbolDefinitions.WixBundlePatchTargetCode, null, null)
51 {
52 }
53
54 public WixBundlePatchTargetCodeSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundlePatchTargetCode, sourceLineNumber, id)
55 {
56 }
57
58 public IntermediateField this[WixBundlePatchTargetCodeSymbolFields index] => this.Fields[(int)index];
59
60 public string PackageRef
61 {
62 get => (string)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.PackageRef];
63 set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.PackageRef, value);
64 }
65
66 public string TargetCode
67 {
68 get => (string)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.TargetCode];
69 set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.TargetCode, value);
70 }
71
72 public WixBundlePatchTargetCodeAttributes Attributes
73 {
74 get => (WixBundlePatchTargetCodeAttributes)this.Fields[(int)WixBundlePatchTargetCodeSymbolFields.Attributes].AsNumber();
75 set => this.Set((int)WixBundlePatchTargetCodeSymbolFields.Attributes, (int)value);
76 }
77
78 public bool TargetsProductCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsProductCode) == WixBundlePatchTargetCodeAttributes.TargetsProductCode;
79
80 public bool TargetsUpgradeCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode) == WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode;
81 }
82}