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