| 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 WixBundlePayload = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.WixBundlePayload, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Attributes), IntermediateFieldType.Number), |
| 14 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Name), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.SourceFile), IntermediateFieldType.Path), |
| 16 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.DownloadUrl), IntermediateFieldType.String), |
| 17 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Compressed), IntermediateFieldType.Bool), |
| 18 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.UnresolvedSourceFile), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.DisplayName), IntermediateFieldType.String), |
| 20 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Description), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.FileSize), IntermediateFieldType.LargeNumber), |
| 22 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Version), IntermediateFieldType.String), |
| 23 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Hash), IntermediateFieldType.String), |
| 24 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.ContainerRef), IntermediateFieldType.String), |
| 25 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.EmbeddedId), IntermediateFieldType.String), |
| 26 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.LayoutOnly), IntermediateFieldType.Bool), |
| 27 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.Packaging), IntermediateFieldType.Number), |
| 28 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.ParentPackagePayloadRef), IntermediateFieldType.String), |
| 29 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.CertificatePublicKey), IntermediateFieldType.String), |
| 30 | new IntermediateFieldDefinition(nameof(WixBundlePayloadSymbolFields.CertificateThumbprint), IntermediateFieldType.String), |
| 31 | }, |
| 32 | typeof(WixBundlePayloadSymbol)); |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | namespace WixToolset.Data.Symbols |
| 37 | { |
| 38 | using System; |
| 39 | |
| 40 | public enum WixBundlePayloadSymbolFields |
| 41 | { |
| 42 | Attributes, |
| 43 | Name, |
| 44 | SourceFile, |
| 45 | DownloadUrl, |
| 46 | Compressed, |
| 47 | UnresolvedSourceFile, |
| 48 | DisplayName, |
| 49 | Description, |
| 50 | FileSize, |
| 51 | Version, |
| 52 | Hash, |
| 53 | ContainerRef, |
| 54 | EmbeddedId, |
| 55 | LayoutOnly, |
| 56 | Packaging, |
| 57 | ParentPackagePayloadRef, |
| 58 | CertificatePublicKey, |
| 59 | CertificateThumbprint, |
| 60 | } |
| 61 | |
| 62 | [Flags] |
| 63 | public enum WixBundlePayloadAttributes |
| 64 | { |
| 65 | None = 0x0, |
| 66 | ContentFile = 0x1, |
| 67 | } |
| 68 | |
| 69 | public class WixBundlePayloadSymbol : IntermediateSymbol |
| 70 | { |
| 71 | public WixBundlePayloadSymbol() : base(SymbolDefinitions.WixBundlePayload, null, null) |
| 72 | { |
| 73 | } |
| 74 | |
| 75 | public WixBundlePayloadSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixBundlePayload, sourceLineNumber, id) |
| 76 | { |
| 77 | } |
| 78 | |
| 79 | public IntermediateField this[WixBundlePayloadSymbolFields index] => this.Fields[(int)index]; |
| 80 | |
| 81 | public WixBundlePayloadAttributes Attributes |
| 82 | { |
| 83 | get => (WixBundlePayloadAttributes)this.Fields[(int)WixBundlePayloadSymbolFields.Attributes].AsNumber(); |
| 84 | set => this.Set((int)WixBundlePayloadSymbolFields.Attributes, (int)value); |
| 85 | } |
| 86 | |
| 87 | public string Name |
| 88 | { |
| 89 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.Name]; |
| 90 | set => this.Set((int)WixBundlePayloadSymbolFields.Name, value); |
| 91 | } |
| 92 | |
| 93 | public IntermediateFieldPathValue SourceFile |
| 94 | { |
| 95 | get => this.Fields[(int)WixBundlePayloadSymbolFields.SourceFile].AsPath(); |
| 96 | set => this.Set((int)WixBundlePayloadSymbolFields.SourceFile, value); |
| 97 | } |
| 98 | |
| 99 | public string DownloadUrl |
| 100 | { |
| 101 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.DownloadUrl]; |
| 102 | set => this.Set((int)WixBundlePayloadSymbolFields.DownloadUrl, value); |
| 103 | } |
| 104 | |
| 105 | public bool? Compressed |
| 106 | { |
| 107 | get => (bool?)this.Fields[(int)WixBundlePayloadSymbolFields.Compressed]; |
| 108 | set => this.Set((int)WixBundlePayloadSymbolFields.Compressed, value); |
| 109 | } |
| 110 | |
| 111 | public string UnresolvedSourceFile |
| 112 | { |
| 113 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.UnresolvedSourceFile]; |
| 114 | set => this.Set((int)WixBundlePayloadSymbolFields.UnresolvedSourceFile, value); |
| 115 | } |
| 116 | |
| 117 | public string DisplayName |
| 118 | { |
| 119 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.DisplayName]; |
| 120 | set => this.Set((int)WixBundlePayloadSymbolFields.DisplayName, value); |
| 121 | } |
| 122 | |
| 123 | public string Description |
| 124 | { |
| 125 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.Description]; |
| 126 | set => this.Set((int)WixBundlePayloadSymbolFields.Description, value); |
| 127 | } |
| 128 | |
| 129 | public long? FileSize |
| 130 | { |
| 131 | get => (long?)this.Fields[(int)WixBundlePayloadSymbolFields.FileSize]; |
| 132 | set => this.Set((int)WixBundlePayloadSymbolFields.FileSize, value); |
| 133 | } |
| 134 | |
| 135 | public string Version |
| 136 | { |
| 137 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.Version]; |
| 138 | set => this.Set((int)WixBundlePayloadSymbolFields.Version, value); |
| 139 | } |
| 140 | |
| 141 | public string Hash |
| 142 | { |
| 143 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.Hash]; |
| 144 | set => this.Set((int)WixBundlePayloadSymbolFields.Hash, value); |
| 145 | } |
| 146 | |
| 147 | public string ContainerRef |
| 148 | { |
| 149 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.ContainerRef]; |
| 150 | set => this.Set((int)WixBundlePayloadSymbolFields.ContainerRef, value); |
| 151 | } |
| 152 | |
| 153 | public string EmbeddedId |
| 154 | { |
| 155 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.EmbeddedId]; |
| 156 | set => this.Set((int)WixBundlePayloadSymbolFields.EmbeddedId, value); |
| 157 | } |
| 158 | |
| 159 | public bool LayoutOnly |
| 160 | { |
| 161 | get => (bool)this.Fields[(int)WixBundlePayloadSymbolFields.LayoutOnly]; |
| 162 | set => this.Set((int)WixBundlePayloadSymbolFields.LayoutOnly, value); |
| 163 | } |
| 164 | |
| 165 | public PackagingType? Packaging |
| 166 | { |
| 167 | get => (PackagingType?)this.Fields[(int)WixBundlePayloadSymbolFields.Packaging].AsNumber(); |
| 168 | set => this.Set((int)WixBundlePayloadSymbolFields.Packaging, (int?)value); |
| 169 | } |
| 170 | |
| 171 | public string ParentPackagePayloadRef |
| 172 | { |
| 173 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.ParentPackagePayloadRef]; |
| 174 | set => this.Set((int)WixBundlePayloadSymbolFields.ParentPackagePayloadRef, value); |
| 175 | } |
| 176 | |
| 177 | public string CertificatePublicKey |
| 178 | { |
| 179 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.CertificatePublicKey]; |
| 180 | set => this.Set((int)WixBundlePayloadSymbolFields.CertificatePublicKey, value); |
| 181 | } |
| 182 | |
| 183 | public string CertificateThumbprint |
| 184 | { |
| 185 | get => (string)this.Fields[(int)WixBundlePayloadSymbolFields.CertificateThumbprint]; |
| 186 | set => this.Set((int)WixBundlePayloadSymbolFields.CertificateThumbprint, value); |
| 187 | } |
| 188 | |
| 189 | public bool ContentFile |
| 190 | { |
| 191 | get { return this.Attributes.HasFlag(WixBundlePayloadAttributes.ContentFile); } |
| 192 | set |
| 193 | { |
| 194 | if (value) |
| 195 | { |
| 196 | this.Attributes |= WixBundlePayloadAttributes.ContentFile; |
| 197 | } |
| 198 | else |
| 199 | { |
| 200 | this.Attributes &= ~WixBundlePayloadAttributes.ContentFile; |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | } |