aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/Tuples/SqlTupleDefinitions.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/Tuples/SqlTupleDefinitions.cs')
-rw-r--r--src/wixext/Tuples/SqlTupleDefinitions.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/wixext/Tuples/SqlTupleDefinitions.cs b/src/wixext/Tuples/SqlTupleDefinitions.cs
new file mode 100644
index 00000000..b99b96a7
--- /dev/null
+++ b/src/wixext/Tuples/SqlTupleDefinitions.cs
@@ -0,0 +1,51 @@
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
3namespace WixToolset.Sql
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum SqlTupleDefinitionType
9 {
10 SqlDatabase,
11 SqlFileSpec,
12 SqlScript,
13 SqlString,
14 }
15
16 public static partial class SqlTupleDefinitions
17 {
18 public static readonly Version Version = new Version("4.0.0");
19
20 public static IntermediateTupleDefinition ByName(string name)
21 {
22 if (!Enum.TryParse(name, out SqlTupleDefinitionType type))
23 {
24 return null;
25 }
26
27 return ByType(type);
28 }
29
30 public static IntermediateTupleDefinition ByType(SqlTupleDefinitionType type)
31 {
32 switch (type)
33 {
34 case SqlTupleDefinitionType.SqlDatabase:
35 return SqlTupleDefinitions.SqlDatabase;
36
37 case SqlTupleDefinitionType.SqlFileSpec:
38 return SqlTupleDefinitions.SqlFileSpec;
39
40 case SqlTupleDefinitionType.SqlScript:
41 return SqlTupleDefinitions.SqlScript;
42
43 case SqlTupleDefinitionType.SqlString:
44 return SqlTupleDefinitions.SqlString;
45
46 default:
47 throw new ArgumentOutOfRangeException(nameof(type));
48 }
49 }
50 }
51}