diff options
Diffstat (limited to 'src/WixToolset.Data/Symbols/ComboBoxSymbol.cs')
-rw-r--r-- | src/WixToolset.Data/Symbols/ComboBoxSymbol.cs | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Symbols/ComboBoxSymbol.cs b/src/WixToolset.Data/Symbols/ComboBoxSymbol.cs new file mode 100644 index 00000000..c7d8d986 --- /dev/null +++ b/src/WixToolset.Data/Symbols/ComboBoxSymbol.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 | |||
3 | namespace WixToolset.Data | ||
4 | { | ||
5 | using WixToolset.Data.Symbols; | ||
6 | |||
7 | public static partial class SymbolDefinitions | ||
8 | { | ||
9 | public static readonly IntermediateSymbolDefinition ComboBox = new IntermediateSymbolDefinition( | ||
10 | SymbolDefinitionType.ComboBox, | ||
11 | new[] | ||
12 | { | ||
13 | new IntermediateFieldDefinition(nameof(ComboBoxSymbolFields.Property), IntermediateFieldType.String), | ||
14 | new IntermediateFieldDefinition(nameof(ComboBoxSymbolFields.Order), IntermediateFieldType.Number), | ||
15 | new IntermediateFieldDefinition(nameof(ComboBoxSymbolFields.Value), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(ComboBoxSymbolFields.Text), IntermediateFieldType.String), | ||
17 | }, | ||
18 | typeof(ComboBoxSymbol)); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | namespace WixToolset.Data.Symbols | ||
23 | { | ||
24 | public enum ComboBoxSymbolFields | ||
25 | { | ||
26 | Property, | ||
27 | Order, | ||
28 | Value, | ||
29 | Text, | ||
30 | } | ||
31 | |||
32 | public class ComboBoxSymbol : IntermediateSymbol | ||
33 | { | ||
34 | public ComboBoxSymbol() : base(SymbolDefinitions.ComboBox, null, null) | ||
35 | { | ||
36 | } | ||
37 | |||
38 | public ComboBoxSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ComboBox, sourceLineNumber, id) | ||
39 | { | ||
40 | } | ||
41 | |||
42 | public IntermediateField this[ComboBoxSymbolFields index] => this.Fields[(int)index]; | ||
43 | |||
44 | public string Property | ||
45 | { | ||
46 | get => (string)this.Fields[(int)ComboBoxSymbolFields.Property]; | ||
47 | set => this.Set((int)ComboBoxSymbolFields.Property, value); | ||
48 | } | ||
49 | |||
50 | public int Order | ||
51 | { | ||
52 | get => (int)this.Fields[(int)ComboBoxSymbolFields.Order]; | ||
53 | set => this.Set((int)ComboBoxSymbolFields.Order, value); | ||
54 | } | ||
55 | |||
56 | public string Value | ||
57 | { | ||
58 | get => (string)this.Fields[(int)ComboBoxSymbolFields.Value]; | ||
59 | set => this.Set((int)ComboBoxSymbolFields.Value, value); | ||
60 | } | ||
61 | |||
62 | public string Text | ||
63 | { | ||
64 | get => (string)this.Fields[(int)ComboBoxSymbolFields.Text]; | ||
65 | set => this.Set((int)ComboBoxSymbolFields.Text, value); | ||
66 | } | ||
67 | } | ||
68 | } \ No newline at end of file | ||