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