aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/Tuples/ListBoxTuple.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2017-11-01 10:56:09 -0700
committerRob Mensching <rob@firegiant.com>2017-11-01 10:56:09 -0700
commit69b15d96cebdbb7201b1849b4f62786633d70b8d (patch)
tree4b65de8679e4b4ab81b69edcccbac1ae9f55a16d /src/WixToolset.Data/Tuples/ListBoxTuple.cs
parenta8656a87887d6cb2c54f4bbeacee37f7074f1032 (diff)
downloadwix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.gz
wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.bz2
wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.zip
Introduce WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data/Tuples/ListBoxTuple.cs')
-rw-r--r--src/WixToolset.Data/Tuples/ListBoxTuple.cs68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/ListBoxTuple.cs b/src/WixToolset.Data/Tuples/ListBoxTuple.cs
new file mode 100644
index 00000000..71702c07
--- /dev/null
+++ b/src/WixToolset.Data/Tuples/ListBoxTuple.cs
@@ -0,0 +1,68 @@
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.Data
4{
5 using WixToolset.Data.Tuples;
6
7 public static partial class TupleDefinitions
8 {
9 public static readonly IntermediateTupleDefinition ListBox = new IntermediateTupleDefinition(
10 TupleDefinitionType.ListBox,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(ListBoxTupleFields.Property), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(ListBoxTupleFields.Order), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(ListBoxTupleFields.Value), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(ListBoxTupleFields.Text), IntermediateFieldType.String),
17 },
18 typeof(ListBoxTuple));
19 }
20}
21
22namespace WixToolset.Data.Tuples
23{
24 public enum ListBoxTupleFields
25 {
26 Property,
27 Order,
28 Value,
29 Text,
30 }
31
32 public class ListBoxTuple : IntermediateTuple
33 {
34 public ListBoxTuple() : base(TupleDefinitions.ListBox, null, null)
35 {
36 }
37
38 public ListBoxTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ListBox, sourceLineNumber, id)
39 {
40 }
41
42 public IntermediateField this[ListBoxTupleFields index] => this.Fields[(int)index];
43
44 public string Property
45 {
46 get => (string)this.Fields[(int)ListBoxTupleFields.Property]?.Value;
47 set => this.Set((int)ListBoxTupleFields.Property, value);
48 }
49
50 public int Order
51 {
52 get => (int)this.Fields[(int)ListBoxTupleFields.Order]?.Value;
53 set => this.Set((int)ListBoxTupleFields.Order, value);
54 }
55
56 public string Value
57 {
58 get => (string)this.Fields[(int)ListBoxTupleFields.Value]?.Value;
59 set => this.Set((int)ListBoxTupleFields.Value, value);
60 }
61
62 public string Text
63 {
64 get => (string)this.Fields[(int)ListBoxTupleFields.Text]?.Value;
65 set => this.Set((int)ListBoxTupleFields.Text, value);
66 }
67 }
68} \ No newline at end of file