diff options
Diffstat (limited to 'src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs index f8752067..56ca144f 100644 --- a/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs | |||
| @@ -10,7 +10,7 @@ namespace WixToolset.Data | |||
| 10 | TupleDefinitionType.WixBundlePatchTargetCode, | 10 | TupleDefinitionType.WixBundlePatchTargetCode, |
| 11 | new[] | 11 | new[] |
| 12 | { | 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.PackageId), IntermediateFieldType.String), | 13 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.PackageRef), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.TargetCode), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.TargetCode), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.Attributes), IntermediateFieldType.Number), | 15 | new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.Attributes), IntermediateFieldType.Number), |
| 16 | }, | 16 | }, |
| @@ -20,13 +20,31 @@ namespace WixToolset.Data | |||
| 20 | 20 | ||
| 21 | namespace WixToolset.Data.Tuples | 21 | namespace WixToolset.Data.Tuples |
| 22 | { | 22 | { |
| 23 | using System; | ||
| 24 | |||
| 23 | public enum WixBundlePatchTargetCodeTupleFields | 25 | public enum WixBundlePatchTargetCodeTupleFields |
| 24 | { | 26 | { |
| 25 | PackageId, | 27 | PackageRef, |
| 26 | TargetCode, | 28 | TargetCode, |
| 27 | Attributes, | 29 | Attributes, |
| 28 | } | 30 | } |
| 29 | 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 | |||
| 30 | public class WixBundlePatchTargetCodeTuple : IntermediateTuple | 48 | public class WixBundlePatchTargetCodeTuple : IntermediateTuple |
| 31 | { | 49 | { |
| 32 | public WixBundlePatchTargetCodeTuple() : base(TupleDefinitions.WixBundlePatchTargetCode, null, null) | 50 | public WixBundlePatchTargetCodeTuple() : base(TupleDefinitions.WixBundlePatchTargetCode, null, null) |
| @@ -39,10 +57,10 @@ namespace WixToolset.Data.Tuples | |||
| 39 | 57 | ||
| 40 | public IntermediateField this[WixBundlePatchTargetCodeTupleFields index] => this.Fields[(int)index]; | 58 | public IntermediateField this[WixBundlePatchTargetCodeTupleFields index] => this.Fields[(int)index]; |
| 41 | 59 | ||
| 42 | public string PackageId | 60 | public string PackageRef |
| 43 | { | 61 | { |
| 44 | get => (string)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.PackageId]; | 62 | get => (string)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.PackageRef]; |
| 45 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.PackageId, value); | 63 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.PackageRef, value); |
| 46 | } | 64 | } |
| 47 | 65 | ||
| 48 | public string TargetCode | 66 | public string TargetCode |
| @@ -51,10 +69,14 @@ namespace WixToolset.Data.Tuples | |||
| 51 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.TargetCode, value); | 69 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.TargetCode, value); |
| 52 | } | 70 | } |
| 53 | 71 | ||
| 54 | public int Attributes | 72 | public WixBundlePatchTargetCodeAttributes Attributes |
| 55 | { | 73 | { |
| 56 | get => (int)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.Attributes]; | 74 | get => (WixBundlePatchTargetCodeAttributes)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.Attributes].AsNumber(); |
| 57 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.Attributes, value); | 75 | set => this.Set((int)WixBundlePatchTargetCodeTupleFields.Attributes, (int)value); |
| 58 | } | 76 | } |
| 77 | |||
| 78 | public bool TargetsProductCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsProductCode) == WixBundlePatchTargetCodeAttributes.TargetsProductCode; | ||
| 79 | |||
| 80 | public bool TargetsUpgradeCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode) == WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode; | ||
| 59 | } | 81 | } |
| 60 | } \ No newline at end of file | 82 | } |
