From ef6485ac4a03333701d343c1e3a52d25805c58f1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 8 May 2019 13:35:21 -0700 Subject: Add additional strongly typed tuples --- .../Tuples/MsiServiceConfigTuple.cs | 48 +++++++++++++++------- 1 file changed, 33 insertions(+), 15 deletions(-) (limited to 'src/WixToolset.Data/Tuples/MsiServiceConfigTuple.cs') diff --git a/src/WixToolset.Data/Tuples/MsiServiceConfigTuple.cs b/src/WixToolset.Data/Tuples/MsiServiceConfigTuple.cs index 701d85b4..c0e8e459 100644 --- a/src/WixToolset.Data/Tuples/MsiServiceConfigTuple.cs +++ b/src/WixToolset.Data/Tuples/MsiServiceConfigTuple.cs @@ -10,9 +10,10 @@ namespace WixToolset.Data TupleDefinitionType.MsiServiceConfig, new[] { - new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.MsiServiceConfig), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.Name), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.Event), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsTupleFields.OnInstall), IntermediateFieldType.Bool), + new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsTupleFields.OnReinstall), IntermediateFieldType.Bool), + new IntermediateFieldDefinition(nameof(MsiServiceConfigFailureActionsTupleFields.OnUninstall), IntermediateFieldType.Bool), new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.ConfigType), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.Argument), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(MsiServiceConfigTupleFields.Component_), IntermediateFieldType.String), @@ -27,12 +28,23 @@ namespace WixToolset.Data.Tuples { MsiServiceConfig, Name, - Event, + OnInstall, + OnReinstall, + OnUninstall, ConfigType, Argument, Component_, } + public enum MsiServiceConfigType + { + DelayedAutoStart = 3, + FailureActionsFlag, + ServiceSidInfo, + RequiredPrivilegesInfo, + PreshutdownInfo, + } + public class MsiServiceConfigTuple : IntermediateTuple { public MsiServiceConfigTuple() : base(TupleDefinitions.MsiServiceConfig, null, null) @@ -45,28 +57,34 @@ namespace WixToolset.Data.Tuples public IntermediateField this[MsiServiceConfigTupleFields index] => this.Fields[(int)index]; - public string MsiServiceConfig - { - get => (string)this.Fields[(int)MsiServiceConfigTupleFields.MsiServiceConfig]?.Value; - set => this.Set((int)MsiServiceConfigTupleFields.MsiServiceConfig, value); - } - public string Name { get => (string)this.Fields[(int)MsiServiceConfigTupleFields.Name]?.Value; set => this.Set((int)MsiServiceConfigTupleFields.Name, value); } - public int Event + public bool OnInstall + { + get => this.Fields[(int)MsiServiceConfigTupleFields.OnInstall].AsBool(); + set => this.Set((int)MsiServiceConfigTupleFields.OnInstall, value); + } + + public bool OnReinstall + { + get => this.Fields[(int)MsiServiceConfigTupleFields.OnReinstall].AsBool(); + set => this.Set((int)MsiServiceConfigTupleFields.OnReinstall, value); + } + + public bool OnUninstall { - get => (int)this.Fields[(int)MsiServiceConfigTupleFields.Event]?.Value; - set => this.Set((int)MsiServiceConfigTupleFields.Event, value); + get => this.Fields[(int)MsiServiceConfigTupleFields.OnUninstall].AsBool(); + set => this.Set((int)MsiServiceConfigTupleFields.OnUninstall, value); } - public int ConfigType + public MsiServiceConfigType ConfigType { - get => (int)this.Fields[(int)MsiServiceConfigTupleFields.ConfigType]?.Value; - set => this.Set((int)MsiServiceConfigTupleFields.ConfigType, value); + get => (MsiServiceConfigType)this.Fields[(int)MsiServiceConfigTupleFields.ConfigType].AsNumber(); + set => this.Set((int)MsiServiceConfigTupleFields.ConfigType, (int)value); } public string Argument -- cgit v1.2.3-55-g6feb