diff options
Diffstat (limited to 'src/wixext/Tuples/HttpTupleDefinitions.cs')
-rw-r--r-- | src/wixext/Tuples/HttpTupleDefinitions.cs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/wixext/Tuples/HttpTupleDefinitions.cs b/src/wixext/Tuples/HttpTupleDefinitions.cs new file mode 100644 index 00000000..11305d2a --- /dev/null +++ b/src/wixext/Tuples/HttpTupleDefinitions.cs | |||
@@ -0,0 +1,43 @@ | |||
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.Http | ||
4 | { | ||
5 | using System; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | public enum HttpTupleDefinitionType | ||
9 | { | ||
10 | WixHttpUrlAce, | ||
11 | WixHttpUrlReservation, | ||
12 | } | ||
13 | |||
14 | public static partial class HttpTupleDefinitions | ||
15 | { | ||
16 | public static readonly Version Version = new Version("4.0.0"); | ||
17 | |||
18 | public static IntermediateTupleDefinition ByName(string name) | ||
19 | { | ||
20 | if (!Enum.TryParse(name, out HttpTupleDefinitionType type)) | ||
21 | { | ||
22 | return null; | ||
23 | } | ||
24 | |||
25 | return ByType(type); | ||
26 | } | ||
27 | |||
28 | public static IntermediateTupleDefinition ByType(HttpTupleDefinitionType type) | ||
29 | { | ||
30 | switch (type) | ||
31 | { | ||
32 | case HttpTupleDefinitionType.WixHttpUrlAce: | ||
33 | return HttpTupleDefinitions.WixHttpUrlAce; | ||
34 | |||
35 | case HttpTupleDefinitionType.WixHttpUrlReservation: | ||
36 | return HttpTupleDefinitions.WixHttpUrlReservation; | ||
37 | |||
38 | default: | ||
39 | throw new ArgumentOutOfRangeException(nameof(type)); | ||
40 | } | ||
41 | } | ||
42 | } | ||
43 | } | ||