| 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 ControlCondition = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.ControlCondition, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(ControlConditionSymbolFields.DialogRef), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(ControlConditionSymbolFields.ControlRef), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(ControlConditionSymbolFields.Action), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(ControlConditionSymbolFields.Condition), IntermediateFieldType.String), |
| 17 | }, |
| 18 | typeof(ControlConditionSymbol)); |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | namespace WixToolset.Data.Symbols |
| 23 | { |
| 24 | public enum ControlConditionSymbolFields |
| 25 | { |
| 26 | DialogRef, |
| 27 | ControlRef, |
| 28 | Action, |
| 29 | Condition, |
| 30 | } |
| 31 | |
| 32 | public class ControlConditionSymbol : IntermediateSymbol |
| 33 | { |
| 34 | public ControlConditionSymbol() : base(SymbolDefinitions.ControlCondition, null, null) |
| 35 | { |
| 36 | } |
| 37 | |
| 38 | public ControlConditionSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ControlCondition, sourceLineNumber, id) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | public IntermediateField this[ControlConditionSymbolFields index] => this.Fields[(int)index]; |
| 43 | |
| 44 | public string DialogRef |
| 45 | { |
| 46 | get => (string)this.Fields[(int)ControlConditionSymbolFields.DialogRef]; |
| 47 | set => this.Set((int)ControlConditionSymbolFields.DialogRef, value); |
| 48 | } |
| 49 | |
| 50 | public string ControlRef |
| 51 | { |
| 52 | get => (string)this.Fields[(int)ControlConditionSymbolFields.ControlRef]; |
| 53 | set => this.Set((int)ControlConditionSymbolFields.ControlRef, value); |
| 54 | } |
| 55 | |
| 56 | public string Action |
| 57 | { |
| 58 | get => (string)this.Fields[(int)ControlConditionSymbolFields.Action]; |
| 59 | set => this.Set((int)ControlConditionSymbolFields.Action, value); |
| 60 | } |
| 61 | |
| 62 | public string Condition |
| 63 | { |
| 64 | get => (string)this.Fields[(int)ControlConditionSymbolFields.Condition]; |
| 65 | set => this.Set((int)ControlConditionSymbolFields.Condition, value); |
| 66 | } |
| 67 | } |
| 68 | } |