diff options
Diffstat (limited to 'src/WixToolset.Data/Tuples/CustomActionTuple.cs')
-rw-r--r-- | src/WixToolset.Data/Tuples/CustomActionTuple.cs | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/CustomActionTuple.cs b/src/WixToolset.Data/Tuples/CustomActionTuple.cs new file mode 100644 index 00000000..a5d8fd46 --- /dev/null +++ b/src/WixToolset.Data/Tuples/CustomActionTuple.cs | |||
@@ -0,0 +1,76 @@ | |||
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 CustomAction = new IntermediateTupleDefinition( | ||
10 | TupleDefinitionType.CustomAction, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(CustomActionTupleFields.Action), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(CustomActionTupleFields.Type), IntermediateFieldType.Number), | ||
15 | new IntermediateFieldDefinition(nameof(CustomActionTupleFields.Source), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(CustomActionTupleFields.Target), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(CustomActionTupleFields.ExtendedType), IntermediateFieldType.Number), | ||
18 | }, | ||
19 | typeof(CustomActionTuple)); | ||
20 | } | ||
21 | } | ||
22 | |||
23 | namespace WixToolset.Data.Tuples | ||
24 | { | ||
25 | public enum CustomActionTupleFields | ||
26 | { | ||
27 | Action, | ||
28 | Type, | ||
29 | Source, | ||
30 | Target, | ||
31 | ExtendedType, | ||
32 | } | ||
33 | |||
34 | public class CustomActionTuple : IntermediateTuple | ||
35 | { | ||
36 | public CustomActionTuple() : base(TupleDefinitions.CustomAction, null, null) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | public CustomActionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.CustomAction, sourceLineNumber, id) | ||
41 | { | ||
42 | } | ||
43 | |||
44 | public IntermediateField this[CustomActionTupleFields index] => this.Fields[(int)index]; | ||
45 | |||
46 | public string Action | ||
47 | { | ||
48 | get => (string)this.Fields[(int)CustomActionTupleFields.Action]?.Value; | ||
49 | set => this.Set((int)CustomActionTupleFields.Action, value); | ||
50 | } | ||
51 | |||
52 | public int Type | ||
53 | { | ||
54 | get => (int)this.Fields[(int)CustomActionTupleFields.Type]?.Value; | ||
55 | set => this.Set((int)CustomActionTupleFields.Type, value); | ||
56 | } | ||
57 | |||
58 | public string Source | ||
59 | { | ||
60 | get => (string)this.Fields[(int)CustomActionTupleFields.Source]?.Value; | ||
61 | set => this.Set((int)CustomActionTupleFields.Source, value); | ||
62 | } | ||
63 | |||
64 | public string Target | ||
65 | { | ||
66 | get => (string)this.Fields[(int)CustomActionTupleFields.Target]?.Value; | ||
67 | set => this.Set((int)CustomActionTupleFields.Target, value); | ||
68 | } | ||
69 | |||
70 | public int ExtendedType | ||
71 | { | ||
72 | get => (int)this.Fields[(int)CustomActionTupleFields.ExtendedType]?.Value; | ||
73 | set => this.Set((int)CustomActionTupleFields.ExtendedType, value); | ||
74 | } | ||
75 | } | ||
76 | } \ No newline at end of file | ||