| 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 RemoveRegistry = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.RemoveRegistry, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(RemoveRegistrySymbolFields.Root), IntermediateFieldType.Number), |
| 14 | new IntermediateFieldDefinition(nameof(RemoveRegistrySymbolFields.Key), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(RemoveRegistrySymbolFields.Name), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(RemoveRegistrySymbolFields.Action), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(RemoveRegistrySymbolFields.ComponentRef), IntermediateFieldType.String), |
| 18 | }, |
| 19 | typeof(RemoveRegistrySymbol)); |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | namespace WixToolset.Data.Symbols |
| 24 | { |
| 25 | public enum RemoveRegistrySymbolFields |
| 26 | { |
| 27 | Root, |
| 28 | Key, |
| 29 | Name, |
| 30 | Action, |
| 31 | ComponentRef, |
| 32 | } |
| 33 | |
| 34 | public enum RemoveRegistryActionType |
| 35 | { |
| 36 | RemoveOnInstall, |
| 37 | RemoveOnUninstall |
| 38 | }; |
| 39 | |
| 40 | public class RemoveRegistrySymbol : IntermediateSymbol |
| 41 | { |
| 42 | public RemoveRegistrySymbol() : base(SymbolDefinitions.RemoveRegistry, null, null) |
| 43 | { |
| 44 | } |
| 45 | |
| 46 | public RemoveRegistrySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.RemoveRegistry, sourceLineNumber, id) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | public IntermediateField this[RemoveRegistrySymbolFields index] => this.Fields[(int)index]; |
| 51 | |
| 52 | public RegistryRootType Root |
| 53 | { |
| 54 | get => (RegistryRootType)this.Fields[(int)RemoveRegistrySymbolFields.Root].AsNumber(); |
| 55 | set => this.Set((int)RemoveRegistrySymbolFields.Root, (int)value); |
| 56 | } |
| 57 | |
| 58 | public string Key |
| 59 | { |
| 60 | get => (string)this.Fields[(int)RemoveRegistrySymbolFields.Key]; |
| 61 | set => this.Set((int)RemoveRegistrySymbolFields.Key, value); |
| 62 | } |
| 63 | |
| 64 | public string Name |
| 65 | { |
| 66 | get => (string)this.Fields[(int)RemoveRegistrySymbolFields.Name]; |
| 67 | set => this.Set((int)RemoveRegistrySymbolFields.Name, value); |
| 68 | } |
| 69 | |
| 70 | public RemoveRegistryActionType Action |
| 71 | { |
| 72 | get => (RemoveRegistryActionType)this.Fields[(int)RemoveRegistrySymbolFields.Action].AsNumber(); |
| 73 | set => this.Set((int)RemoveRegistrySymbolFields.Action, (int)value); |
| 74 | } |
| 75 | |
| 76 | public string ComponentRef |
| 77 | { |
| 78 | get => (string)this.Fields[(int)RemoveRegistrySymbolFields.ComponentRef]; |
| 79 | set => this.Set((int)RemoveRegistrySymbolFields.ComponentRef, value); |
| 80 | } |
| 81 | } |
| 82 | } |