aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/ServiceConfigTuple.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/Tuples/ServiceConfigTuple.cs')
-rw-r--r--src/wixext/Tuples/ServiceConfigTuple.cs119
1 files changed, 119 insertions, 0 deletions
diff --git a/src/wixext/Tuples/ServiceConfigTuple.cs b/src/wixext/Tuples/ServiceConfigTuple.cs
new file mode 100644
index 00000000..74d96bca
--- /dev/null
+++ b/src/wixext/Tuples/ServiceConfigTuple.cs
@@ -0,0 +1,119 @@
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
3namespace WixToolset.Util
4{
5 using WixToolset.Data;
6 using WixToolset.Util.Tuples;
7
8 public static partial class UtilTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition ServiceConfig = new IntermediateTupleDefinition(
11 UtilTupleDefinitionType.ServiceConfig.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ServiceName), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.NewService), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.FirstFailureActionType), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.SecondFailureActionType), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ThirdFailureActionType), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ResetPeriodInDays), IntermediateFieldType.Number),
21 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RestartServiceDelayInSeconds), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.ProgramCommandLine), IntermediateFieldType.String),
23 new IntermediateFieldDefinition(nameof(ServiceConfigTupleFields.RebootMessage), IntermediateFieldType.String),
24 },
25 typeof(ServiceConfigTuple));
26 }
27}
28
29namespace WixToolset.Util.Tuples
30{
31 using WixToolset.Data;
32
33 public enum ServiceConfigTupleFields
34 {
35 ServiceName,
36 Component_,
37 NewService,
38 FirstFailureActionType,
39 SecondFailureActionType,
40 ThirdFailureActionType,
41 ResetPeriodInDays,
42 RestartServiceDelayInSeconds,
43 ProgramCommandLine,
44 RebootMessage,
45 }
46
47 public class ServiceConfigTuple : IntermediateTuple
48 {
49 public ServiceConfigTuple() : base(UtilTupleDefinitions.ServiceConfig, null, null)
50 {
51 }
52
53 public ServiceConfigTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(UtilTupleDefinitions.ServiceConfig, sourceLineNumber, id)
54 {
55 }
56
57 public IntermediateField this[ServiceConfigTupleFields index] => this.Fields[(int)index];
58
59 public string ServiceName
60 {
61 get => this.Fields[(int)ServiceConfigTupleFields.ServiceName].AsString();
62 set => this.Set((int)ServiceConfigTupleFields.ServiceName, value);
63 }
64
65 public string Component_
66 {
67 get => this.Fields[(int)ServiceConfigTupleFields.Component_].AsString();
68 set => this.Set((int)ServiceConfigTupleFields.Component_, value);
69 }
70
71 public int NewService
72 {
73 get => this.Fields[(int)ServiceConfigTupleFields.NewService].AsNumber();
74 set => this.Set((int)ServiceConfigTupleFields.NewService, value);
75 }
76
77 public string FirstFailureActionType
78 {
79 get => this.Fields[(int)ServiceConfigTupleFields.FirstFailureActionType].AsString();
80 set => this.Set((int)ServiceConfigTupleFields.FirstFailureActionType, value);
81 }
82
83 public string SecondFailureActionType
84 {
85 get => this.Fields[(int)ServiceConfigTupleFields.SecondFailureActionType].AsString();
86 set => this.Set((int)ServiceConfigTupleFields.SecondFailureActionType, value);
87 }
88
89 public string ThirdFailureActionType
90 {
91 get => this.Fields[(int)ServiceConfigTupleFields.ThirdFailureActionType].AsString();
92 set => this.Set((int)ServiceConfigTupleFields.ThirdFailureActionType, value);
93 }
94
95 public int ResetPeriodInDays
96 {
97 get => this.Fields[(int)ServiceConfigTupleFields.ResetPeriodInDays].AsNumber();
98 set => this.Set((int)ServiceConfigTupleFields.ResetPeriodInDays, value);
99 }
100
101 public int RestartServiceDelayInSeconds
102 {
103 get => this.Fields[(int)ServiceConfigTupleFields.RestartServiceDelayInSeconds].AsNumber();
104 set => this.Set((int)ServiceConfigTupleFields.RestartServiceDelayInSeconds, value);
105 }
106
107 public string ProgramCommandLine
108 {
109 get => this.Fields[(int)ServiceConfigTupleFields.ProgramCommandLine].AsString();
110 set => this.Set((int)ServiceConfigTupleFields.ProgramCommandLine, value);
111 }
112
113 public string RebootMessage
114 {
115 get => this.Fields[(int)ServiceConfigTupleFields.RebootMessage].AsString();
116 set => this.Set((int)ServiceConfigTupleFields.RebootMessage, value);
117 }
118 }
119} \ No newline at end of file