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