| 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 WixCustomTableColumn = new IntermediateSymbolDefinition( |
| 10 | SymbolDefinitionType.WixCustomTableColumn, |
| 11 | new[] |
| 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.TableRef), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Name), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Type), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Attributes), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Width), IntermediateFieldType.Number), |
| 18 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.MinValue), IntermediateFieldType.String), |
| 19 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.MaxValue), IntermediateFieldType.String), |
| 20 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.KeyTable), IntermediateFieldType.String), |
| 21 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.KeyColumn), IntermediateFieldType.String), |
| 22 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Category), IntermediateFieldType.String), |
| 23 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Set), IntermediateFieldType.String), |
| 24 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Description), IntermediateFieldType.String), |
| 25 | new IntermediateFieldDefinition(nameof(WixCustomTableColumnSymbolFields.Modularize), IntermediateFieldType.Number) |
| 26 | }, |
| 27 | typeof(WixCustomTableColumnSymbol)); |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | namespace WixToolset.Data.Symbols |
| 32 | { |
| 33 | using System; |
| 34 | |
| 35 | public enum WixCustomTableColumnSymbolFields |
| 36 | { |
| 37 | TableRef, |
| 38 | Name, |
| 39 | Type, |
| 40 | Attributes, |
| 41 | Width, |
| 42 | MinValue, |
| 43 | MaxValue, |
| 44 | KeyTable, |
| 45 | KeyColumn, |
| 46 | Category, |
| 47 | Set, |
| 48 | Description, |
| 49 | Modularize, |
| 50 | } |
| 51 | |
| 52 | [Flags] |
| 53 | public enum WixCustomTableColumnSymbolAttributes |
| 54 | { |
| 55 | None = 0x0, |
| 56 | PrimaryKey = 0x1, |
| 57 | Localizable = 0x2, |
| 58 | Nullable = 0x4, |
| 59 | Unreal = 0x8, |
| 60 | } |
| 61 | |
| 62 | public enum WixCustomTableColumnCategoryType |
| 63 | { |
| 64 | Text, |
| 65 | UpperCase, |
| 66 | LowerCase, |
| 67 | Integer, |
| 68 | DoubleInteger, |
| 69 | TimeDate, |
| 70 | Identifier, |
| 71 | Property, |
| 72 | Filename, |
| 73 | WildCardFilename, |
| 74 | Path, |
| 75 | Paths, |
| 76 | AnyPath, |
| 77 | DefaultDir, |
| 78 | RegPath, |
| 79 | Formatted, |
| 80 | FormattedSddl, |
| 81 | Template, |
| 82 | Condition, |
| 83 | Guid, |
| 84 | Version, |
| 85 | Language, |
| 86 | Binary, |
| 87 | CustomSource, |
| 88 | Cabinet, |
| 89 | Shortcut, |
| 90 | } |
| 91 | |
| 92 | public enum WixCustomTableColumnModularizeType |
| 93 | { |
| 94 | None, |
| 95 | Column, |
| 96 | CompanionFile, |
| 97 | Condition, |
| 98 | ControlEventArgument, |
| 99 | ControlText, |
| 100 | Icon, |
| 101 | Property, |
| 102 | SemicolonDelimited, |
| 103 | } |
| 104 | |
| 105 | public class WixCustomTableColumnSymbol : IntermediateSymbol |
| 106 | { |
| 107 | public WixCustomTableColumnSymbol() : base(SymbolDefinitions.WixCustomTableColumn, null, null) |
| 108 | { |
| 109 | } |
| 110 | |
| 111 | public WixCustomTableColumnSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixCustomTableColumn, sourceLineNumber, id) |
| 112 | { |
| 113 | } |
| 114 | |
| 115 | public IntermediateField this[WixCustomTableColumnSymbolFields index] => this.Fields[(int)index]; |
| 116 | |
| 117 | public string TableRef |
| 118 | { |
| 119 | get => (string)this.Fields[(int)WixCustomTableColumnSymbolFields.TableRef]; |
| 120 | set => this.Set((int)WixCustomTableColumnSymbolFields.TableRef, value); |
| 121 | } |
| 122 | |
| 123 | public string Name |
| 124 | { |
| 125 | get => (string)this.Fields[(int)WixCustomTableColumnSymbolFields.Name]; |
| 126 | set => this.Set((int)WixCustomTableColumnSymbolFields.Name, value); |
| 127 | } |
| 128 | |
| 129 | public IntermediateFieldType Type |
| 130 | { |
| 131 | get => (IntermediateFieldType)this.Fields[(int)WixCustomTableColumnSymbolFields.Type].AsNumber(); |
| 132 | set => this.Set((int)WixCustomTableColumnSymbolFields.Type, (int)value); |
| 133 | } |
| 134 | |
| 135 | public WixCustomTableColumnSymbolAttributes Attributes |
| 136 | { |
| 137 | get => (WixCustomTableColumnSymbolAttributes)this.Fields[(int)WixCustomTableColumnSymbolFields.Attributes].AsNumber(); |
| 138 | set => this.Set((int)WixCustomTableColumnSymbolFields.Attributes, (int)value); |
| 139 | } |
| 140 | |
| 141 | public int Width |
| 142 | { |
| 143 | get => (int)this.Fields[(int)WixCustomTableColumnSymbolFields.Width]; |
| 144 | set => this.Set((int)WixCustomTableColumnSymbolFields.Width, value); |
| 145 | } |
| 146 | |
| 147 | public long? MinValue |
| 148 | { |
| 149 | get => (long?)this.Fields[(int)WixCustomTableColumnSymbolFields.MinValue]; |
| 150 | set => this.Set((int)WixCustomTableColumnSymbolFields.MinValue, value); |
| 151 | } |
| 152 | |
| 153 | public long? MaxValue |
| 154 | { |
| 155 | get => (long?)this.Fields[(int)WixCustomTableColumnSymbolFields.MaxValue]; |
| 156 | set => this.Set((int)WixCustomTableColumnSymbolFields.MaxValue, value); |
| 157 | } |
| 158 | |
| 159 | public string KeyTable |
| 160 | { |
| 161 | get => (string)this.Fields[(int)WixCustomTableColumnSymbolFields.KeyTable]; |
| 162 | set => this.Set((int)WixCustomTableColumnSymbolFields.KeyTable, value); |
| 163 | } |
| 164 | |
| 165 | public int? KeyColumn |
| 166 | { |
| 167 | get => (int?)this.Fields[(int)WixCustomTableColumnSymbolFields.KeyColumn]; |
| 168 | set => this.Set((int)WixCustomTableColumnSymbolFields.KeyColumn, value); |
| 169 | } |
| 170 | |
| 171 | public WixCustomTableColumnCategoryType? Category |
| 172 | { |
| 173 | get => (WixCustomTableColumnCategoryType?)this.Fields[(int)WixCustomTableColumnSymbolFields.Category].AsNullableNumber(); |
| 174 | set => this.Set((int)WixCustomTableColumnSymbolFields.Category, (int?)value); |
| 175 | } |
| 176 | |
| 177 | public string Set |
| 178 | { |
| 179 | get => (string)this.Fields[(int)WixCustomTableColumnSymbolFields.Set]; |
| 180 | set => this.Set((int)WixCustomTableColumnSymbolFields.Set, value); |
| 181 | } |
| 182 | |
| 183 | public string Description |
| 184 | { |
| 185 | get => (string)this.Fields[(int)WixCustomTableColumnSymbolFields.Description]; |
| 186 | set => this.Set((int)WixCustomTableColumnSymbolFields.Description, value); |
| 187 | } |
| 188 | |
| 189 | public WixCustomTableColumnModularizeType? Modularize |
| 190 | { |
| 191 | get => (WixCustomTableColumnModularizeType?)this.Fields[(int)WixCustomTableColumnSymbolFields.Modularize].AsNullableNumber(); |
| 192 | set => this.Set((int)WixCustomTableColumnSymbolFields.Modularize, (int?)value); |
| 193 | } |
| 194 | |
| 195 | public bool PrimaryKey => (this.Attributes & WixCustomTableColumnSymbolAttributes.PrimaryKey) == WixCustomTableColumnSymbolAttributes.PrimaryKey; |
| 196 | |
| 197 | public bool Localizable => (this.Attributes & WixCustomTableColumnSymbolAttributes.Localizable) == WixCustomTableColumnSymbolAttributes.Localizable; |
| 198 | |
| 199 | public bool Nullable => (this.Attributes & WixCustomTableColumnSymbolAttributes.Nullable) == WixCustomTableColumnSymbolAttributes.Nullable; |
| 200 | |
| 201 | public bool Unreal => (this.Attributes & WixCustomTableColumnSymbolAttributes.Unreal) == WixCustomTableColumnSymbolAttributes.Unreal; |
| 202 | } |
| 203 | } |