diff options
Diffstat (limited to 'src/WixToolset.Data/Tuples/WixActionTuple.cs')
-rw-r--r-- | src/WixToolset.Data/Tuples/WixActionTuple.cs | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/WixActionTuple.cs b/src/WixToolset.Data/Tuples/WixActionTuple.cs new file mode 100644 index 00000000..53ea52de --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixActionTuple.cs | |||
@@ -0,0 +1,103 @@ | |||
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.Tuples; | ||
6 | |||
7 | public static partial class TupleDefinitions | ||
8 | { | ||
9 | public static readonly IntermediateTupleDefinition WixAction = new IntermediateTupleDefinition( | ||
10 | TupleDefinitionType.WixAction, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.SequenceTable), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.Action), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.Condition), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.Sequence), IntermediateFieldType.Number), | ||
17 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.Before), IntermediateFieldType.String), | ||
18 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.After), IntermediateFieldType.String), | ||
19 | new IntermediateFieldDefinition(nameof(WixActionTupleFields.Overridable), IntermediateFieldType.Bool), | ||
20 | }, | ||
21 | typeof(WixActionTuple)); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | namespace WixToolset.Data.Tuples | ||
26 | { | ||
27 | using System; | ||
28 | |||
29 | public enum WixActionTupleFields | ||
30 | { | ||
31 | SequenceTable, | ||
32 | Action, | ||
33 | Condition, | ||
34 | Sequence, | ||
35 | Before, | ||
36 | After, | ||
37 | Overridable, | ||
38 | } | ||
39 | |||
40 | public enum SequenceTable | ||
41 | { | ||
42 | AdminUISequence, | ||
43 | AdminExecuteSequence, | ||
44 | AdvtExecuteSequence, | ||
45 | InstallUISequence, | ||
46 | InstallExecuteSequence | ||
47 | } | ||
48 | |||
49 | public class WixActionTuple : IntermediateTuple | ||
50 | { | ||
51 | public WixActionTuple() : base(TupleDefinitions.WixAction, null, null) | ||
52 | { | ||
53 | } | ||
54 | |||
55 | public WixActionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixAction, sourceLineNumber, id) | ||
56 | { | ||
57 | } | ||
58 | |||
59 | public IntermediateField this[WixActionTupleFields index] => this.Fields[(int)index]; | ||
60 | |||
61 | public SequenceTable SequenceTable | ||
62 | { | ||
63 | get => (SequenceTable)Enum.Parse(typeof(SequenceTable), (string)this.Fields[(int)WixActionTupleFields.SequenceTable]?.Value); | ||
64 | set => this.Set((int)WixActionTupleFields.SequenceTable, value.ToString()); | ||
65 | } | ||
66 | |||
67 | public string Action | ||
68 | { | ||
69 | get => (string)this.Fields[(int)WixActionTupleFields.Action]?.Value; | ||
70 | set => this.Set((int)WixActionTupleFields.Action, value); | ||
71 | } | ||
72 | |||
73 | public string Condition | ||
74 | { | ||
75 | get => (string)this.Fields[(int)WixActionTupleFields.Condition]?.Value; | ||
76 | set => this.Set((int)WixActionTupleFields.Condition, value); | ||
77 | } | ||
78 | |||
79 | public int Sequence | ||
80 | { | ||
81 | get => (int)this.Fields[(int)WixActionTupleFields.Sequence]?.Value; | ||
82 | set => this.Set((int)WixActionTupleFields.Sequence, value); | ||
83 | } | ||
84 | |||
85 | public string Before | ||
86 | { | ||
87 | get => (string)this.Fields[(int)WixActionTupleFields.Before]?.Value; | ||
88 | set => this.Set((int)WixActionTupleFields.Before, value); | ||
89 | } | ||
90 | |||
91 | public string After | ||
92 | { | ||
93 | get => (string)this.Fields[(int)WixActionTupleFields.After]?.Value; | ||
94 | set => this.Set((int)WixActionTupleFields.After, value); | ||
95 | } | ||
96 | |||
97 | public bool Overridable | ||
98 | { | ||
99 | get => (bool)this.Fields[(int)WixActionTupleFields.Overridable]?.Value; | ||
100 | set => this.Set((int)WixActionTupleFields.Overridable, value); | ||
101 | } | ||
102 | } | ||
103 | } \ No newline at end of file | ||