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