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