aboutsummaryrefslogtreecommitdiff
path: root/src/wixext/FirewallErrors.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext/FirewallErrors.cs')
-rw-r--r--src/wixext/FirewallErrors.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/wixext/FirewallErrors.cs b/src/wixext/FirewallErrors.cs
new file mode 100644
index 00000000..3fff8c8d
--- /dev/null
+++ b/src/wixext/FirewallErrors.cs
@@ -0,0 +1,42 @@
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
3namespace WixToolset.Firewall
4{
5 using System.Resources;
6 using WixToolset.Data;
7
8 public static class FirewallErrors
9 {
10 public static Message IllegalRemoteAddressWithScopeAttribute(SourceLineNumber sourceLineNumbers)
11 {
12 return Message(sourceLineNumbers, Ids.IllegalRemoteAddressWithScopeAttribute, "The RemoteAddress element cannot be specified because its parent FirewallException already specified the Scope attribute. To use RemoteAddress elements, omit the Scope attribute.");
13 }
14
15 public static Message IllegalEmptyRemoteAddress(SourceLineNumber sourceLineNumbers)
16 {
17 return Message(sourceLineNumbers, Ids.IllegalEmptyRemoteAddress, "The RemoteAddress element's inner text cannot be an empty string or completely whitespace.");
18 }
19
20 public static Message NoExceptionSpecified(SourceLineNumber sourceLineNumbers)
21 {
22 return Message(sourceLineNumbers, Ids.NoExceptionSpecified, "The FirewallException element doesn't identify the target of the firewall exception. To create an application exception, nest the FirewallException element under a File element or provide a value for the File or Program attributes. To create a port exception, provide a value for the Port attribute.");
23 }
24
25 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
26 {
27 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
28 }
29
30 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
31 {
32 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
33 }
34
35 public enum Ids
36 {
37 IllegalRemoteAddressWithScopeAttribute = 6401,
38 IllegalEmptyRemoteAddress = 6402,
39 NoExceptionSpecified = 6403,
40 }
41 }
42}