diff options
Diffstat (limited to 'src/wixext/SqlErrors.cs')
-rw-r--r-- | src/wixext/SqlErrors.cs | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/src/wixext/SqlErrors.cs b/src/wixext/SqlErrors.cs index 2043b658..f25728bd 100644 --- a/src/wixext/SqlErrors.cs +++ b/src/wixext/SqlErrors.cs | |||
@@ -1,32 +1,48 @@ | |||
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. | 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 | 2 | ||
3 | namespace WixToolset.Extensions | 3 | namespace WixToolset.Sql |
4 | { | 4 | { |
5 | public sealed class SqlErrors | 5 | using System.Resources; |
6 | using WixToolset.Data; | ||
7 | |||
8 | public static class SqlErrors | ||
6 | { | 9 | { |
7 | 10 | public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | |
8 | private SqlErrors() | ||
9 | { | 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); | ||
10 | } | 13 | } |
11 | 14 | ||
12 | public static MessageEventArgs IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) | 15 | public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) |
13 | { | 16 | { |
14 | return new SqlErrorEventArgs(sourceLineNumbers, 5100, "SqlErrors_IllegalAttributeWithoutComponent_1", elementName, attributeName); | 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); |
15 | } | 18 | } |
16 | 19 | ||
17 | public static MessageEventArgs IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName) | 20 | public static Message OneOfAttributesRequiredUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4) |
18 | { | 21 | { |
19 | return new SqlErrorEventArgs(sourceLineNumbers, 5101, "SqlErrors_IllegalElementWithoutComponent_1", elementName); | 22 | return Message(sourceLineNumbers, Ids.OneOfAttributesRequiredUnderComponent, "When nested under a Component, the {0} element must have one of the following attributes specified: {1}, {2}, {3} or {4}.", elementName, attributeName1, attributeName2, attributeName3, attributeName4); |
20 | } | 23 | } |
21 | 24 | ||
22 | public static MessageEventArgs OneOfAttributesRequiredUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4) | 25 | public static Message DeprecatedBinaryChildElement(SourceLineNumber sourceLineNumbers, string elementName) |
23 | { | 26 | { |
24 | return new SqlErrorEventArgs(sourceLineNumbers, 5102, "SqlErrors_OneOfAttributesRequiredUnderComponent_1", elementName, attributeName1, attributeName2, attributeName3, attributeName4); | 27 | return Message(sourceLineNumbers, Ids.DeprecatedBinaryChildElement, "The {0} element contains a deprecated child Binary element. Please move the Binary element under a Fragment, Module, or Product element and set the {0}/@BinaryKey attribute to the value of the Binary/@Id attribute.", elementName); |
25 | } | 28 | } |
26 | 29 | ||
27 | public static MessageEventArgs DeprecatedBinaryChildElement(SourceLineNumber sourceLineNumbers, string elementName) | 30 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
31 | { | ||
32 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); | ||
33 | } | ||
34 | |||
35 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) | ||
36 | { | ||
37 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); | ||
38 | } | ||
39 | |||
40 | public enum Ids | ||
28 | { | 41 | { |
29 | return new SqlErrorEventArgs(sourceLineNumbers, 5103, "SqlErrors_DeprecatedBinaryChildElement_1", elementName); | 42 | IllegalAttributeWithoutComponent = 5100, |
43 | IllegalElementWithoutComponent = 5101, | ||
44 | OneOfAttributesRequiredUnderComponent = 5102, | ||
45 | DeprecatedBinaryChildElement = 5103, | ||
30 | } | 46 | } |
31 | } | 47 | } |
32 | } \ No newline at end of file | 48 | } \ No newline at end of file |