| 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 Dialog = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.Dialog, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.HCentering), IntermediateFieldType.Number), |
| 14 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.VCentering), IntermediateFieldType.Number), |
| 15 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Width), IntermediateFieldType.Number), |
| 16 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Height), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.CustomPalette), IntermediateFieldType.Bool), |
| 18 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.ErrorDialog), IntermediateFieldType.Bool), |
| 19 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Visible), IntermediateFieldType.Bool), |
| 20 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Modal), IntermediateFieldType.Bool), |
| 21 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.KeepModeless), IntermediateFieldType.Bool), |
| 22 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.LeftScroll), IntermediateFieldType.Bool), |
| 23 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Minimize), IntermediateFieldType.Bool), |
| 24 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.RightAligned), IntermediateFieldType.Bool), |
| 25 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.RightToLeft), IntermediateFieldType.Bool), |
| 26 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.SystemModal), IntermediateFieldType.Bool), |
| 27 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.TrackDiskSpace), IntermediateFieldType.Bool), |
| 28 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.Title), IntermediateFieldType.String), |
| 29 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.FirstControlRef), IntermediateFieldType.String), |
| 30 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.DefaultControlRef), IntermediateFieldType.String), |
| 31 | new IntermediateFieldDefinition(nameof(DialogSymbolFields.CancelControlRef), IntermediateFieldType.String), |
| 32 | }, |
| 33 | typeof(DialogSymbol)); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | namespace WixToolset.Data.Symbols |
| 38 | { |
| 39 | public enum DialogSymbolFields |
| 40 | { |
| 41 | HCentering, |
| 42 | VCentering, |
| 43 | Width, |
| 44 | Height, |
| 45 | CustomPalette, |
| 46 | ErrorDialog, |
| 47 | Visible, |
| 48 | Modal, |
| 49 | KeepModeless, |
| 50 | LeftScroll, |
| 51 | Minimize, |
| 52 | RightAligned, |
| 53 | RightToLeft, |
| 54 | SystemModal, |
| 55 | TrackDiskSpace, |
| 56 | Title, |
| 57 | FirstControlRef, |
| 58 | DefaultControlRef, |
| 59 | CancelControlRef, |
| 60 | } |
| 61 | |
| 62 | public class DialogSymbol : IntermediateSymbol |
| 63 | { |
| 64 | public DialogSymbol() : base(SymbolDefinitions.Dialog, null, null) |
| 65 | { |
| 66 | } |
| 67 | |
| 68 | public DialogSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.Dialog, sourceLineNumber, id) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | public IntermediateField this[DialogSymbolFields index] => this.Fields[(int)index]; |
| 73 | |
| 74 | public int HCentering |
| 75 | { |
| 76 | get => (int)this.Fields[(int)DialogSymbolFields.HCentering]; |
| 77 | set => this.Set((int)DialogSymbolFields.HCentering, value); |
| 78 | } |
| 79 | |
| 80 | public int VCentering |
| 81 | { |
| 82 | get => (int)this.Fields[(int)DialogSymbolFields.VCentering]; |
| 83 | set => this.Set((int)DialogSymbolFields.VCentering, value); |
| 84 | } |
| 85 | |
| 86 | public int Width |
| 87 | { |
| 88 | get => (int)this.Fields[(int)DialogSymbolFields.Width]; |
| 89 | set => this.Set((int)DialogSymbolFields.Width, value); |
| 90 | } |
| 91 | |
| 92 | public int Height |
| 93 | { |
| 94 | get => (int)this.Fields[(int)DialogSymbolFields.Height]; |
| 95 | set => this.Set((int)DialogSymbolFields.Height, value); |
| 96 | } |
| 97 | |
| 98 | public bool CustomPalette |
| 99 | { |
| 100 | get => this.Fields[(int)DialogSymbolFields.CustomPalette].AsBool(); |
| 101 | set => this.Set((int)DialogSymbolFields.CustomPalette, value); |
| 102 | } |
| 103 | |
| 104 | public bool ErrorDialog |
| 105 | { |
| 106 | get => this.Fields[(int)DialogSymbolFields.ErrorDialog].AsBool(); |
| 107 | set => this.Set((int)DialogSymbolFields.ErrorDialog, value); |
| 108 | } |
| 109 | |
| 110 | public bool Visible |
| 111 | { |
| 112 | get => this.Fields[(int)DialogSymbolFields.Visible].AsBool(); |
| 113 | set => this.Set((int)DialogSymbolFields.Visible, value); |
| 114 | } |
| 115 | |
| 116 | public bool Modal |
| 117 | { |
| 118 | get => this.Fields[(int)DialogSymbolFields.Modal].AsBool(); |
| 119 | set => this.Set((int)DialogSymbolFields.Modal, value); |
| 120 | } |
| 121 | |
| 122 | public bool KeepModeless |
| 123 | { |
| 124 | get => this.Fields[(int)DialogSymbolFields.KeepModeless].AsBool(); |
| 125 | set => this.Set((int)DialogSymbolFields.KeepModeless, value); |
| 126 | } |
| 127 | |
| 128 | public bool LeftScroll |
| 129 | { |
| 130 | get => this.Fields[(int)DialogSymbolFields.LeftScroll].AsBool(); |
| 131 | set => this.Set((int)DialogSymbolFields.LeftScroll, value); |
| 132 | } |
| 133 | |
| 134 | public bool Minimize |
| 135 | { |
| 136 | get => this.Fields[(int)DialogSymbolFields.Minimize].AsBool(); |
| 137 | set => this.Set((int)DialogSymbolFields.Minimize, value); |
| 138 | } |
| 139 | |
| 140 | public bool RightAligned |
| 141 | { |
| 142 | get => this.Fields[(int)DialogSymbolFields.RightAligned].AsBool(); |
| 143 | set => this.Set((int)DialogSymbolFields.RightAligned, value); |
| 144 | } |
| 145 | |
| 146 | public bool RightToLeft |
| 147 | { |
| 148 | get => this.Fields[(int)DialogSymbolFields.RightToLeft].AsBool(); |
| 149 | set => this.Set((int)DialogSymbolFields.RightToLeft, value); |
| 150 | } |
| 151 | |
| 152 | public bool TrackDiskSpace |
| 153 | { |
| 154 | get => this.Fields[(int)DialogSymbolFields.TrackDiskSpace].AsBool(); |
| 155 | set => this.Set((int)DialogSymbolFields.TrackDiskSpace, value); |
| 156 | } |
| 157 | |
| 158 | public bool SystemModal |
| 159 | { |
| 160 | get => this.Fields[(int)DialogSymbolFields.SystemModal].AsBool(); |
| 161 | set => this.Set((int)DialogSymbolFields.SystemModal, value); |
| 162 | } |
| 163 | |
| 164 | public string Title |
| 165 | { |
| 166 | get => (string)this.Fields[(int)DialogSymbolFields.Title]; |
| 167 | set => this.Set((int)DialogSymbolFields.Title, value); |
| 168 | } |
| 169 | |
| 170 | public string FirstControlRef |
| 171 | { |
| 172 | get => (string)this.Fields[(int)DialogSymbolFields.FirstControlRef]; |
| 173 | set => this.Set((int)DialogSymbolFields.FirstControlRef, value); |
| 174 | } |
| 175 | |
| 176 | public string DefaultControlRef |
| 177 | { |
| 178 | get => (string)this.Fields[(int)DialogSymbolFields.DefaultControlRef]; |
| 179 | set => this.Set((int)DialogSymbolFields.DefaultControlRef, value); |
| 180 | } |
| 181 | |
| 182 | public string CancelControlRef |
| 183 | { |
| 184 | get => (string)this.Fields[(int)DialogSymbolFields.CancelControlRef]; |
| 185 | set => this.Set((int)DialogSymbolFields.CancelControlRef, value); |
| 186 | } |
| 187 | } |
| 188 | } |