| 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 WixBundleMspPackage = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.WixBundleMspPackage, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixBundleMspPackageSymbolFields.Attributes), IntermediateFieldType.Number), |
| 14 | new IntermediateFieldDefinition(nameof(WixBundleMspPackageSymbolFields.PatchCode), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixBundleMspPackageSymbolFields.Manufacturer), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixBundleMspPackageSymbolFields.PatchXml), IntermediateFieldType.String), |
| 17 | }, |
| 18 | typeof(WixBundleMspPackageSymbol)); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | namespace WixToolset.Data.Symbols |
| 23 | { |
| 24 | using System; |
| 25 | |
| 26 | public enum WixBundleMspPackageSymbolFields |
| 27 | { |
| 28 | Attributes, |
| 29 | PatchCode, |
| 30 | Manufacturer, |
| 31 | PatchXml, |
| 32 | } |
| 33 | |
| 34 | [Flags] |
| 35 | public enum WixBundleMspPackageAttributes |
| 36 | { |
| 37 | None = 0x0, |
| 38 | Slipstream = 0x1, |
| 39 | } |
| 40 | |
| 41 | public class WixBundleMspPackageSymbol : IntermediateSymbol |
| 42 | { |
| 43 | public WixBundleMspPackageSymbol() : base(SymbolDefinitions.WixBundleMspPackage, null, null) |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | public WixBundleMspPackageSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundleMspPackage, sourceLineNumber, id) |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | public IntermediateField this[WixBundleMspPackageSymbolFields index] => this.Fields[(int)index]; |
| 52 | |
| 53 | public WixBundleMspPackageAttributes Attributes |
| 54 | { |
| 55 | get => (WixBundleMspPackageAttributes)(int)this.Fields[(int)WixBundleMspPackageSymbolFields.Attributes]; |
| 56 | set => this.Set((int)WixBundleMspPackageSymbolFields.Attributes, (int)value); |
| 57 | } |
| 58 | |
| 59 | public string PatchCode |
| 60 | { |
| 61 | get => (string)this.Fields[(int)WixBundleMspPackageSymbolFields.PatchCode]; |
| 62 | set => this.Set((int)WixBundleMspPackageSymbolFields.PatchCode, value); |
| 63 | } |
| 64 | |
| 65 | public string Manufacturer |
| 66 | { |
| 67 | get => (string)this.Fields[(int)WixBundleMspPackageSymbolFields.Manufacturer]; |
| 68 | set => this.Set((int)WixBundleMspPackageSymbolFields.Manufacturer, value); |
| 69 | } |
| 70 | |
| 71 | public string PatchXml |
| 72 | { |
| 73 | get => (string)this.Fields[(int)WixBundleMspPackageSymbolFields.PatchXml]; |
| 74 | set => this.Set((int)WixBundleMspPackageSymbolFields.PatchXml, value); |
| 75 | } |
| 76 | |
| 77 | public bool Slipstream |
| 78 | { |
| 79 | get { return this.Attributes.HasFlag(WixBundleMspPackageAttributes.Slipstream); } |
| 80 | set |
| 81 | { |
| 82 | if (value) |
| 83 | { |
| 84 | this.Attributes |= WixBundleMspPackageAttributes.Slipstream; |
| 85 | } |
| 86 | else |
| 87 | { |
| 88 | this.Attributes &= ~WixBundleMspPackageAttributes.Slipstream; |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | } |