main
cs 56 lines 1.94 KB
Raw
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 WixCustomTable = new IntermediateSymbolDefinition(
10 SymbolDefinitionType.WixCustomTable,
11 new[]
12 {
13 new IntermediateFieldDefinition(nameof(WixCustomTableSymbolFields.ColumnNames), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixCustomTableSymbolFields.Unreal), IntermediateFieldType.Bool),
15 },
16 typeof(WixCustomTableSymbol));
17 }
18 }
19
20 namespace WixToolset.Data.Symbols
21 {
22 public enum WixCustomTableSymbolFields
23 {
24 ColumnNames,
25 Unreal,
26 }
27
28 public class WixCustomTableSymbol : IntermediateSymbol
29 {
30 public const char ColumnNamesSeparator = '\x85';
31
32 public WixCustomTableSymbol() : base(SymbolDefinitions.WixCustomTable, null, null)
33 {
34 }
35
36 public WixCustomTableSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixCustomTable, sourceLineNumber, id)
37 {
38 }
39
40 public IntermediateField this[WixCustomTableSymbolFields index] => this.Fields[(int)index];
41
42 public string ColumnNames
43 {
44 get => (string)this.Fields[(int)WixCustomTableSymbolFields.ColumnNames];
45 set => this.Set((int)WixCustomTableSymbolFields.ColumnNames, value);
46 }
47
48 public bool Unreal
49 {
50 get => (bool)this.Fields[(int)WixCustomTableSymbolFields.Unreal];
51 set => this.Set((int)WixCustomTableSymbolFields.Unreal, value);
52 }
53
54 public string[] ColumnNamesSeparated => this.ColumnNames.Split(ColumnNamesSeparator);
55 }
56 }