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/MsmqErrors.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/MsmqErrors.cs')
-rw-r--r-- | src/ext/Msmq/wixext/MsmqErrors.cs | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/ext/Msmq/wixext/MsmqErrors.cs b/src/ext/Msmq/wixext/MsmqErrors.cs new file mode 100644 index 00000000..4342e1cf --- /dev/null +++ b/src/ext/Msmq/wixext/MsmqErrors.cs | |||
@@ -0,0 +1,71 @@ | |||
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.Data | ||
4 | { | ||
5 | using System; | ||
6 | using System.Resources; | ||
7 | |||
8 | public static class MsmqErrors | ||
9 | { | ||
10 | public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | ||
11 | { | ||
12 | return Message(sourceLineNumbers, Ids.IllegalAttributeWithoutComponent, "The {0}/@{1} attribute cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName, attributeName); | ||
13 | } | ||
14 | |||
15 | public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) | ||
16 | { | ||
17 | return Message(sourceLineNumbers, Ids.IllegalElementWithoutComponent, "The {0} element cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName); | ||
18 | } | ||
19 | |||
20 | public static Message RequiredAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) | ||
21 | { | ||
22 | return Message(sourceLineNumbers, Ids.RequiredAttribute, "A {0} element must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2); | ||
23 | } | ||
24 | |||
25 | public static Message RequiredAttributeNotUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) | ||
26 | { | ||
27 | return Message(sourceLineNumbers, Ids.RequiredAttributeNotUnderComponent, "A {0} element not nested under a component must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2); | ||
28 | } | ||
29 | |||
30 | public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | ||
31 | { | ||
32 | return Message(sourceLineNumbers, Ids.RequiredAttributeUnderComponent, "The {0}/@{1} attribute must be provided when {0} element is nested under a component.", elementName, attributeName); | ||
33 | } | ||
34 | |||
35 | public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue) | ||
36 | { | ||
37 | return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute cannot coexist with the {2} attribute's value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue); | ||
38 | } | ||
39 | |||
40 | public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string otherAttributeName, string otherValue) | ||
41 | { | ||
42 | return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'.", elementName, attributeName, value, otherAttributeName, otherValue); | ||
43 | } | ||
44 | |||
45 | public static Message UnexpectedAttributeWithoutOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue) | ||
46 | { | ||
47 | return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithoutOtherValue, "The {0}/@{1} cannot be provided unless the {2} attribute is provided with a value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue); | ||
48 | } | ||
49 | |||
50 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) | ||
51 | { | ||
52 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); | ||
53 | } | ||
54 | |||
55 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) | ||
56 | { | ||
57 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); | ||
58 | } | ||
59 | |||
60 | public enum Ids | ||
61 | { | ||
62 | IllegalAttributeWithoutComponent = 6000, | ||
63 | IllegalElementWithoutComponent = 6001, | ||
64 | UnexpectedAttributeWithOtherValue = 6002, | ||
65 | UnexpectedAttributeWithoutOtherValue = 6003, | ||
66 | RequiredAttributeUnderComponent = 6004, | ||
67 | RequiredAttribute = 6005, | ||
68 | RequiredAttributeNotUnderComponent = 6006, | ||
69 | } | ||
70 | } | ||
71 | } | ||