aboutsummaryrefslogtreecommitdiff
path: root/src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs')
-rw-r--r--src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs129
1 files changed, 129 insertions, 0 deletions
diff --git a/src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs
new file mode 100644
index 00000000..67972b63
--- /dev/null
+++ b/src/api/wix/WixToolset.Data/Symbols/FeatureSymbol.cs
@@ -0,0 +1,129 @@
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.Symbols;
6
7 public static partial class SymbolDefinitions
8 {
9 public static readonly IntermediateSymbolDefinition Feature = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.Feature,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.ParentFeatureRef), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.Title), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.Description), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.Display), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.Level), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.DirectoryRef), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.DisallowAbsent), IntermediateFieldType.Bool),
20 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.DisallowAdvertise), IntermediateFieldType.Bool),
21 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.InstallDefault), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(FeatureSymbolFields.TypicalDefault), IntermediateFieldType.Number),
23 },
24 typeof(FeatureSymbol));
25 }
26}
27
28namespace WixToolset.Data.Symbols
29{
30 public enum FeatureSymbolFields
31 {
32 ParentFeatureRef,
33 Title,
34 Description,
35 Display,
36 Level,
37 DirectoryRef,
38 DisallowAbsent,
39 DisallowAdvertise,
40 InstallDefault,
41 TypicalDefault,
42 }
43
44 public enum FeatureInstallDefault
45 {
46 Local,
47 Source,
48 FollowParent,
49 }
50
51 public enum FeatureTypicalDefault
52 {
53 Install,
54 Advertise
55 }
56
57 public class FeatureSymbol : IntermediateSymbol
58 {
59 public FeatureSymbol() : base(SymbolDefinitions.Feature, null, null)
60 {
61 }
62
63 public FeatureSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Feature, sourceLineNumber, id)
64 {
65 }
66
67 public IntermediateField this[FeatureSymbolFields index] => this.Fields[(int)index];
68
69 public string ParentFeatureRef
70 {
71 get => (string)this.Fields[(int)FeatureSymbolFields.ParentFeatureRef];
72 set => this.Set((int)FeatureSymbolFields.ParentFeatureRef, value);
73 }
74
75 public string Title
76 {
77 get => (string)this.Fields[(int)FeatureSymbolFields.Title];
78 set => this.Set((int)FeatureSymbolFields.Title, value);
79 }
80
81 public string Description
82 {
83 get => (string)this.Fields[(int)FeatureSymbolFields.Description];
84 set => this.Set((int)FeatureSymbolFields.Description, value);
85 }
86
87 public int Display
88 {
89 get => (int)this.Fields[(int)FeatureSymbolFields.Display];
90 set => this.Set((int)FeatureSymbolFields.Display, value);
91 }
92
93 public int Level
94 {
95 get => (int)this.Fields[(int)FeatureSymbolFields.Level];
96 set => this.Set((int)FeatureSymbolFields.Level, value);
97 }
98
99 public string DirectoryRef
100 {
101 get => (string)this.Fields[(int)FeatureSymbolFields.DirectoryRef];
102 set => this.Set((int)FeatureSymbolFields.DirectoryRef, value);
103 }
104
105 public bool DisallowAbsent
106 {
107 get => this.Fields[(int)FeatureSymbolFields.DisallowAbsent].AsBool();
108 set => this.Set((int)FeatureSymbolFields.DisallowAbsent, value);
109 }
110
111 public bool DisallowAdvertise
112 {
113 get => this.Fields[(int)FeatureSymbolFields.DisallowAdvertise].AsBool();
114 set => this.Set((int)FeatureSymbolFields.DisallowAdvertise, value);
115 }
116
117 public FeatureInstallDefault InstallDefault
118 {
119 get => (FeatureInstallDefault)this.Fields[(int)FeatureSymbolFields.InstallDefault].AsNumber();
120 set => this.Set((int)FeatureSymbolFields.InstallDefault, (int)value);
121 }
122
123 public FeatureTypicalDefault TypicalDefault
124 {
125 get => (FeatureTypicalDefault)this.Fields[(int)FeatureSymbolFields.TypicalDefault].AsNumber();
126 set => this.Set((int)FeatureSymbolFields.TypicalDefault, (int)value);
127 }
128 }
129} \ No newline at end of file