| 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 ServiceControl = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.ServiceControl, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.Name), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.InstallRemove), IntermediateFieldType.Bool), |
| 15 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.UninstallRemove), IntermediateFieldType.Bool), |
| 16 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.InstallStart), IntermediateFieldType.Bool), |
| 17 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.UninstallStart), IntermediateFieldType.Bool), |
| 18 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.InstallStop), IntermediateFieldType.Bool), |
| 19 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.UninstallStop), IntermediateFieldType.Bool), |
| 20 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.Arguments), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.Wait), IntermediateFieldType.Bool), |
| 22 | new IntermediateFieldDefinition(nameof(ServiceControlSymbolFields.ComponentRef), IntermediateFieldType.String), |
| 23 | }, |
| 24 | typeof(ServiceControlSymbol)); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | namespace WixToolset.Data.Symbols |
| 29 | { |
| 30 | public enum ServiceControlSymbolFields |
| 31 | { |
| 32 | Name, |
| 33 | InstallRemove, |
| 34 | UninstallRemove, |
| 35 | InstallStart, |
| 36 | UninstallStart, |
| 37 | InstallStop, |
| 38 | UninstallStop, |
| 39 | Arguments, |
| 40 | Wait, |
| 41 | ComponentRef, |
| 42 | } |
| 43 | |
| 44 | public class ServiceControlSymbol : IntermediateSymbol |
| 45 | { |
| 46 | public ServiceControlSymbol() : base(SymbolDefinitions.ServiceControl, null, null) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | public ServiceControlSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ServiceControl, sourceLineNumber, id) |
| 51 | { |
| 52 | } |
| 53 | |
| 54 | public IntermediateField this[ServiceControlSymbolFields index] => this.Fields[(int)index]; |
| 55 | |
| 56 | public string Name |
| 57 | { |
| 58 | get => (string)this.Fields[(int)ServiceControlSymbolFields.Name]; |
| 59 | set => this.Set((int)ServiceControlSymbolFields.Name, value); |
| 60 | } |
| 61 | |
| 62 | public bool InstallRemove |
| 63 | { |
| 64 | get => this.Fields[(int)ServiceControlSymbolFields.InstallRemove].AsBool(); |
| 65 | set => this.Set((int)ServiceControlSymbolFields.InstallRemove, value); |
| 66 | } |
| 67 | |
| 68 | public bool UninstallRemove |
| 69 | { |
| 70 | get => this.Fields[(int)ServiceControlSymbolFields.UninstallRemove].AsBool(); |
| 71 | set => this.Set((int)ServiceControlSymbolFields.UninstallRemove, value); |
| 72 | } |
| 73 | |
| 74 | public bool InstallStart |
| 75 | { |
| 76 | get => this.Fields[(int)ServiceControlSymbolFields.InstallStart].AsBool(); |
| 77 | set => this.Set((int)ServiceControlSymbolFields.InstallStart, value); |
| 78 | } |
| 79 | |
| 80 | public bool UninstallStart |
| 81 | { |
| 82 | get => this.Fields[(int)ServiceControlSymbolFields.UninstallStart].AsBool(); |
| 83 | set => this.Set((int)ServiceControlSymbolFields.UninstallStart, value); |
| 84 | } |
| 85 | |
| 86 | public bool InstallStop |
| 87 | { |
| 88 | get => this.Fields[(int)ServiceControlSymbolFields.InstallStop].AsBool(); |
| 89 | set => this.Set((int)ServiceControlSymbolFields.InstallStop, value); |
| 90 | } |
| 91 | |
| 92 | public bool UninstallStop |
| 93 | { |
| 94 | get => this.Fields[(int)ServiceControlSymbolFields.UninstallStop].AsBool(); |
| 95 | set => this.Set((int)ServiceControlSymbolFields.UninstallStop, value); |
| 96 | } |
| 97 | |
| 98 | public string Arguments |
| 99 | { |
| 100 | get => (string)this.Fields[(int)ServiceControlSymbolFields.Arguments]; |
| 101 | set => this.Set((int)ServiceControlSymbolFields.Arguments, value); |
| 102 | } |
| 103 | |
| 104 | public bool? Wait |
| 105 | { |
| 106 | get => this.Fields[(int)ServiceControlSymbolFields.Wait].AsNullableBool(); |
| 107 | set => this.Set((int)ServiceControlSymbolFields.Wait, value); |
| 108 | } |
| 109 | |
| 110 | public string ComponentRef |
| 111 | { |
| 112 | get => (string)this.Fields[(int)ServiceControlSymbolFields.ComponentRef]; |
| 113 | set => this.Set((int)ServiceControlSymbolFields.ComponentRef, value); |
| 114 | } |
| 115 | } |
| 116 | } |