| 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 Control = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.Control, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.DialogRef), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Control), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Type), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.X), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Y), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Width), IntermediateFieldType.Number), |
| 19 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Height), IntermediateFieldType.Number), |
| 20 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Attributes), IntermediateFieldType.Number), |
| 21 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Enabled), IntermediateFieldType.Bool), |
| 22 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Indirect), IntermediateFieldType.Bool), |
| 23 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Integer), IntermediateFieldType.Bool), |
| 24 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.LeftScroll), IntermediateFieldType.Bool), |
| 25 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.RightAligned), IntermediateFieldType.Bool), |
| 26 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.RightToLeft), IntermediateFieldType.Bool), |
| 27 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Sunken), IntermediateFieldType.Bool), |
| 28 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Visible), IntermediateFieldType.Bool), |
| 29 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Property), IntermediateFieldType.String), |
| 30 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Text), IntermediateFieldType.String), |
| 31 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.NextControlRef), IntermediateFieldType.String), |
| 32 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.Help), IntermediateFieldType.String), |
| 33 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.TrackDiskSpace), IntermediateFieldType.Bool), |
| 34 | new IntermediateFieldDefinition(nameof(ControlSymbolFields.SourceFile), IntermediateFieldType.Path), |
| 35 | }, |
| 36 | typeof(ControlSymbol)); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | namespace WixToolset.Data.Symbols |
| 41 | { |
| 42 | public enum ControlSymbolFields |
| 43 | { |
| 44 | DialogRef, |
| 45 | Control, |
| 46 | Type, |
| 47 | X, |
| 48 | Y, |
| 49 | Width, |
| 50 | Height, |
| 51 | Attributes, |
| 52 | Enabled, |
| 53 | Indirect, |
| 54 | Integer, |
| 55 | LeftScroll, |
| 56 | RightAligned, |
| 57 | RightToLeft, |
| 58 | Sunken, |
| 59 | Visible, |
| 60 | Property, |
| 61 | Text, |
| 62 | NextControlRef, |
| 63 | Help, |
| 64 | TrackDiskSpace, |
| 65 | SourceFile, |
| 66 | } |
| 67 | |
| 68 | public class ControlSymbol : IntermediateSymbol |
| 69 | { |
| 70 | public ControlSymbol() : base(SymbolDefinitions.Control, null, null) |
| 71 | { |
| 72 | } |
| 73 | |
| 74 | public ControlSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Control, sourceLineNumber, id) |
| 75 | { |
| 76 | } |
| 77 | |
| 78 | public IntermediateField this[ControlSymbolFields index] => this.Fields[(int)index]; |
| 79 | |
| 80 | public string DialogRef |
| 81 | { |
| 82 | get => (string)this.Fields[(int)ControlSymbolFields.DialogRef]; |
| 83 | set => this.Set((int)ControlSymbolFields.DialogRef, value); |
| 84 | } |
| 85 | |
| 86 | public string Control |
| 87 | { |
| 88 | get => (string)this.Fields[(int)ControlSymbolFields.Control]; |
| 89 | set => this.Set((int)ControlSymbolFields.Control, value); |
| 90 | } |
| 91 | |
| 92 | public string Type |
| 93 | { |
| 94 | get => (string)this.Fields[(int)ControlSymbolFields.Type]; |
| 95 | set => this.Set((int)ControlSymbolFields.Type, value); |
| 96 | } |
| 97 | |
| 98 | public int X |
| 99 | { |
| 100 | get => (int)this.Fields[(int)ControlSymbolFields.X]; |
| 101 | set => this.Set((int)ControlSymbolFields.X, value); |
| 102 | } |
| 103 | |
| 104 | public int Y |
| 105 | { |
| 106 | get => (int)this.Fields[(int)ControlSymbolFields.Y]; |
| 107 | set => this.Set((int)ControlSymbolFields.Y, value); |
| 108 | } |
| 109 | |
| 110 | public int Width |
| 111 | { |
| 112 | get => (int)this.Fields[(int)ControlSymbolFields.Width]; |
| 113 | set => this.Set((int)ControlSymbolFields.Width, value); |
| 114 | } |
| 115 | |
| 116 | public int Height |
| 117 | { |
| 118 | get => (int)this.Fields[(int)ControlSymbolFields.Height]; |
| 119 | set => this.Set((int)ControlSymbolFields.Height, value); |
| 120 | } |
| 121 | |
| 122 | public int? Attributes |
| 123 | { |
| 124 | get => (int?)this.Fields[(int)ControlSymbolFields.Attributes]; |
| 125 | set => this.Set((int)ControlSymbolFields.Attributes, value); |
| 126 | } |
| 127 | |
| 128 | public bool Enabled |
| 129 | { |
| 130 | get => this.Fields[(int)ControlSymbolFields.Enabled].AsBool(); |
| 131 | set => this.Set((int)ControlSymbolFields.Enabled, value); |
| 132 | } |
| 133 | |
| 134 | public bool Indirect |
| 135 | { |
| 136 | get => this.Fields[(int)ControlSymbolFields.Indirect].AsBool(); |
| 137 | set => this.Set((int)ControlSymbolFields.Indirect, value); |
| 138 | } |
| 139 | |
| 140 | public bool Integer |
| 141 | { |
| 142 | get => this.Fields[(int)ControlSymbolFields.Integer].AsBool(); |
| 143 | set => this.Set((int)ControlSymbolFields.Integer, value); |
| 144 | } |
| 145 | /* |
| 146 | /// <summary>PictureButton control</summary> |
| 147 | public bool Bitmap |
| 148 | { |
| 149 | get => this.Fields[(int)ControlSymbolFields.Bitmap].AsBool(); |
| 150 | set => this.Set((int)ControlSymbolFields.Bitmap, value); |
| 151 | } |
| 152 | |
| 153 | /// <summary>RadioButton control</summary> |
| 154 | public bool Border |
| 155 | { |
| 156 | get => this.Fields[(int)ControlSymbolFields.Border].AsBool(); |
| 157 | set => this.Set((int)ControlSymbolFields.Border, value); |
| 158 | } |
| 159 | |
| 160 | /// <summary>ListBox and ComboBox control</summary> |
| 161 | public bool ComboList |
| 162 | { |
| 163 | get => this.Fields[(int)ControlSymbolFields.ComboList].AsBool(); |
| 164 | set => this.Set((int)ControlSymbolFields.ComboList, value); |
| 165 | } |
| 166 | |
| 167 | /// <summary>PushButton control</summary> |
| 168 | public bool ElevationShield |
| 169 | { |
| 170 | get => this.Fields[(int)ControlSymbolFields.ElevationShield].AsBool(); |
| 171 | set => this.Set((int)ControlSymbolFields.ElevationShield, value); |
| 172 | } |
| 173 | |
| 174 | /// <summary>PictureButton control</summary> |
| 175 | public bool FixedSize |
| 176 | { |
| 177 | get => this.Fields[(int)ControlSymbolFields.FixedSize].AsBool(); |
| 178 | set => this.Set((int)ControlSymbolFields.FixedSize, value); |
| 179 | } |
| 180 | |
| 181 | /// <summary>PictureButton control</summary> |
| 182 | public bool Icon |
| 183 | { |
| 184 | get => this.Fields[(int)ControlSymbolFields.Icon].AsBool(); |
| 185 | set => this.Set((int)ControlSymbolFields.Icon, value); |
| 186 | } |
| 187 | |
| 188 | /// <summary>PictureButton control</summary> |
| 189 | public bool Icon16 |
| 190 | { |
| 191 | get => this.Fields[(int)ControlSymbolFields.Icon16].AsBool(); |
| 192 | set => this.Set((int)ControlSymbolFields.Icon16, value); |
| 193 | } |
| 194 | |
| 195 | /// <summary>PictureButton control</summary> |
| 196 | public bool Icon32 |
| 197 | { |
| 198 | get => this.Fields[(int)ControlSymbolFields.Icon32].AsBool(); |
| 199 | set => this.Set((int)ControlSymbolFields.Icon32, value); |
| 200 | } |
| 201 | |
| 202 | /// <summary>PictureButton control</summary> |
| 203 | public bool Icon48 |
| 204 | { |
| 205 | get => this.Fields[(int)ControlSymbolFields.Icon48].AsBool(); |
| 206 | set => this.Set((int)ControlSymbolFields.Icon48, value); |
| 207 | } |
| 208 | */ |
| 209 | public bool LeftScroll |
| 210 | { |
| 211 | get => this.Fields[(int)ControlSymbolFields.LeftScroll].AsBool(); |
| 212 | set => this.Set((int)ControlSymbolFields.LeftScroll, value); |
| 213 | } |
| 214 | /* |
| 215 | /// <summary>PictureButton control</summary> |
| 216 | public bool PushLike |
| 217 | { |
| 218 | get => this.Fields[(int)ControlSymbolFields.PushLike].AsBool(); |
| 219 | set => this.Set((int)ControlSymbolFields.PushLike, value); |
| 220 | } |
| 221 | |
| 222 | /// <summary>Edit control</summary> |
| 223 | public bool Mulitline |
| 224 | { |
| 225 | get => this.Fields[(int)ControlSymbolFields.Mulitline].AsBool(); |
| 226 | set => this.Set((int)ControlSymbolFields.Mulitline, value); |
| 227 | } |
| 228 | */ |
| 229 | public bool RightAligned |
| 230 | { |
| 231 | get => this.Fields[(int)ControlSymbolFields.RightAligned].AsBool(); |
| 232 | set => this.Set((int)ControlSymbolFields.RightAligned, value); |
| 233 | } |
| 234 | |
| 235 | public bool RightToLeft |
| 236 | { |
| 237 | get => this.Fields[(int)ControlSymbolFields.RightToLeft].AsBool(); |
| 238 | set => this.Set((int)ControlSymbolFields.RightToLeft, value); |
| 239 | } |
| 240 | /* |
| 241 | /// <summary>VolumeCostList control</summary> |
| 242 | public bool ShowRollbackCost |
| 243 | { |
| 244 | get => this.Fields[(int)ControlSymbolFields.ShowRollbackCost].AsBool(); |
| 245 | set => this.Set((int)ControlSymbolFields.ShowRollbackCost, value); |
| 246 | } |
| 247 | |
| 248 | /// <summary>ListBox and ComboBox control</summary> |
| 249 | public bool Sorted |
| 250 | { |
| 251 | get => this.Fields[(int)ControlSymbolFields.Sorted].AsBool(); |
| 252 | set => this.Set((int)ControlSymbolFields.Sorted, value); |
| 253 | } |
| 254 | */ |
| 255 | public bool Sunken |
| 256 | { |
| 257 | get => this.Fields[(int)ControlSymbolFields.Sunken].AsBool(); |
| 258 | set => this.Set((int)ControlSymbolFields.Sunken, value); |
| 259 | } |
| 260 | |
| 261 | public bool Visible |
| 262 | { |
| 263 | get => this.Fields[(int)ControlSymbolFields.Visible].AsBool(); |
| 264 | set => this.Set((int)ControlSymbolFields.Visible, value); |
| 265 | } |
| 266 | |
| 267 | public string Property |
| 268 | { |
| 269 | get => (string)this.Fields[(int)ControlSymbolFields.Property]; |
| 270 | set => this.Set((int)ControlSymbolFields.Property, value); |
| 271 | } |
| 272 | |
| 273 | public string Text |
| 274 | { |
| 275 | get => (string)this.Fields[(int)ControlSymbolFields.Text]; |
| 276 | set => this.Set((int)ControlSymbolFields.Text, value); |
| 277 | } |
| 278 | |
| 279 | public string NextControlRef |
| 280 | { |
| 281 | get => (string)this.Fields[(int)ControlSymbolFields.NextControlRef]; |
| 282 | set => this.Set((int)ControlSymbolFields.NextControlRef, value); |
| 283 | } |
| 284 | |
| 285 | public string Help |
| 286 | { |
| 287 | get => (string)this.Fields[(int)ControlSymbolFields.Help]; |
| 288 | set => this.Set((int)ControlSymbolFields.Help, value); |
| 289 | } |
| 290 | |
| 291 | public bool TrackDiskSpace |
| 292 | { |
| 293 | get => this.Fields[(int)ControlSymbolFields.TrackDiskSpace].AsBool(); |
| 294 | set => this.Set((int)ControlSymbolFields.TrackDiskSpace, value); |
| 295 | } |
| 296 | |
| 297 | public IntermediateFieldPathValue SourceFile |
| 298 | { |
| 299 | get => this.Fields[(int)ControlSymbolFields.SourceFile].AsPath(); |
| 300 | set => this.Set((int)ControlSymbolFields.SourceFile, value); |
| 301 | } |
| 302 | } |
| 303 | } |