diff options
Diffstat (limited to 'src/ext/Sql/wixext/Symbols/SqlScriptSymbol.cs')
-rw-r--r-- | src/ext/Sql/wixext/Symbols/SqlScriptSymbol.cs | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/src/ext/Sql/wixext/Symbols/SqlScriptSymbol.cs b/src/ext/Sql/wixext/Symbols/SqlScriptSymbol.cs new file mode 100644 index 00000000..94c70390 --- /dev/null +++ b/src/ext/Sql/wixext/Symbols/SqlScriptSymbol.cs | |||
@@ -0,0 +1,87 @@ | |||
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.Sql | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Sql.Symbols; | ||
7 | |||
8 | public static partial class SqlSymbolDefinitions | ||
9 | { | ||
10 | public static readonly IntermediateSymbolDefinition SqlScript = new IntermediateSymbolDefinition( | ||
11 | SqlSymbolDefinitionType.SqlScript.ToString(), | ||
12 | new[] | ||
13 | { | ||
14 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.SqlDbRef), IntermediateFieldType.String), | ||
15 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ComponentRef), IntermediateFieldType.String), | ||
16 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.ScriptBinaryRef), IntermediateFieldType.String), | ||
17 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.UserRef), IntermediateFieldType.String), | ||
18 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Attributes), IntermediateFieldType.Number), | ||
19 | new IntermediateFieldDefinition(nameof(SqlScriptSymbolFields.Sequence), IntermediateFieldType.Number), | ||
20 | }, | ||
21 | typeof(SqlScriptSymbol)); | ||
22 | } | ||
23 | } | ||
24 | |||
25 | namespace WixToolset.Sql.Symbols | ||
26 | { | ||
27 | using WixToolset.Data; | ||
28 | |||
29 | public enum SqlScriptSymbolFields | ||
30 | { | ||
31 | SqlDbRef, | ||
32 | ComponentRef, | ||
33 | ScriptBinaryRef, | ||
34 | UserRef, | ||
35 | Attributes, | ||
36 | Sequence, | ||
37 | } | ||
38 | |||
39 | public class SqlScriptSymbol : IntermediateSymbol | ||
40 | { | ||
41 | public SqlScriptSymbol() : base(SqlSymbolDefinitions.SqlScript, null, null) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | public SqlScriptSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SqlSymbolDefinitions.SqlScript, sourceLineNumber, id) | ||
46 | { | ||
47 | } | ||
48 | |||
49 | public IntermediateField this[SqlScriptSymbolFields index] => this.Fields[(int)index]; | ||
50 | |||
51 | public string SqlDbRef | ||
52 | { | ||
53 | get => this.Fields[(int)SqlScriptSymbolFields.SqlDbRef].AsString(); | ||
54 | set => this.Set((int)SqlScriptSymbolFields.SqlDbRef, value); | ||
55 | } | ||
56 | |||
57 | public string ComponentRef | ||
58 | { | ||
59 | get => this.Fields[(int)SqlScriptSymbolFields.ComponentRef].AsString(); | ||
60 | set => this.Set((int)SqlScriptSymbolFields.ComponentRef, value); | ||
61 | } | ||
62 | |||
63 | public string ScriptBinaryRef | ||
64 | { | ||
65 | get => this.Fields[(int)SqlScriptSymbolFields.ScriptBinaryRef].AsString(); | ||
66 | set => this.Set((int)SqlScriptSymbolFields.ScriptBinaryRef, value); | ||
67 | } | ||
68 | |||
69 | public string UserRef | ||
70 | { | ||
71 | get => this.Fields[(int)SqlScriptSymbolFields.UserRef].AsString(); | ||
72 | set => this.Set((int)SqlScriptSymbolFields.UserRef, value); | ||
73 | } | ||
74 | |||
75 | public int Attributes | ||
76 | { | ||
77 | get => this.Fields[(int)SqlScriptSymbolFields.Attributes].AsNumber(); | ||
78 | set => this.Set((int)SqlScriptSymbolFields.Attributes, value); | ||
79 | } | ||
80 | |||
81 | public int? Sequence | ||
82 | { | ||
83 | get => this.Fields[(int)SqlScriptSymbolFields.Sequence].AsNullableNumber(); | ||
84 | set => this.Set((int)SqlScriptSymbolFields.Sequence, value); | ||
85 | } | ||
86 | } | ||
87 | } \ No newline at end of file | ||