diff options
author | Rob Mensching <rob@firegiant.com> | 2021-05-04 22:48:58 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2021-05-04 22:48:58 -0700 |
commit | d77dca43e87e8711b19910a8fd49138f939bf0a4 (patch) | |
tree | 650235e3577bde24518af53e001b7bcbac055da3 /src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs | |
parent | 4426b8745595b6e2c709e08871d04efbf574c1f5 (diff) | |
download | wix-d77dca43e87e8711b19910a8fd49138f939bf0a4.tar.gz wix-d77dca43e87e8711b19910a8fd49138f939bf0a4.tar.bz2 wix-d77dca43e87e8711b19910a8fd49138f939bf0a4.zip |
Move Msmq.wixext into ext
Diffstat (limited to 'src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs')
-rw-r--r-- | src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs b/src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs new file mode 100644 index 00000000..229417fe --- /dev/null +++ b/src/ext/Msmq/wixext/Symbols/MsmqSymbolDefinitions.cs | |||
@@ -0,0 +1,47 @@ | |||
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.Msmq | ||
4 | { | ||
5 | using System; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | public enum MsmqSymbolDefinitionType | ||
9 | { | ||
10 | MessageQueue, | ||
11 | MessageQueueGroupPermission, | ||
12 | MessageQueueUserPermission, | ||
13 | } | ||
14 | |||
15 | public static partial class MsmqSymbolDefinitions | ||
16 | { | ||
17 | public static readonly Version Version = new Version("4.0.0"); | ||
18 | |||
19 | public static IntermediateSymbolDefinition ByName(string name) | ||
20 | { | ||
21 | if (!Enum.TryParse(name, out MsmqSymbolDefinitionType type)) | ||
22 | { | ||
23 | return null; | ||
24 | } | ||
25 | |||
26 | return ByType(type); | ||
27 | } | ||
28 | |||
29 | public static IntermediateSymbolDefinition ByType(MsmqSymbolDefinitionType type) | ||
30 | { | ||
31 | switch (type) | ||
32 | { | ||
33 | case MsmqSymbolDefinitionType.MessageQueue: | ||
34 | return MsmqSymbolDefinitions.MessageQueue; | ||
35 | |||
36 | case MsmqSymbolDefinitionType.MessageQueueGroupPermission: | ||
37 | return MsmqSymbolDefinitions.MessageQueueGroupPermission; | ||
38 | |||
39 | case MsmqSymbolDefinitionType.MessageQueueUserPermission: | ||
40 | return MsmqSymbolDefinitions.MessageQueueUserPermission; | ||
41 | |||
42 | default: | ||
43 | throw new ArgumentOutOfRangeException(nameof(type)); | ||
44 | } | ||
45 | } | ||
46 | } | ||
47 | } | ||