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