| 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.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 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
| 16 | { |
| 17 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); |
| 18 | } |
| 19 | |
| 20 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) |
| 21 | { |
| 22 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); |
| 23 | } |
| 24 | |
| 25 | public static Message IllegalInterfaceWithInterfaceAttribute(SourceLineNumber sourceLineNumbers) |
| 26 | { |
| 27 | return Message(sourceLineNumbers, Ids.IllegalInterfaceWithInterfaceAttribute, "The Interface element cannot be specified because its parent FirewallException already specified the Interface attribute. To use Interface elements, omit the Interface attribute."); |
| 28 | } |
| 29 | |
| 30 | public static Message IllegalInterfaceTypeWithInterfaceTypeAttribute(SourceLineNumber sourceLineNumbers) |
| 31 | { |
| 32 | return Message(sourceLineNumbers, Ids.IllegalInterfaceTypeWithInterfaceTypeAttribute, "The InterfaceType element cannot be specified because its parent FirewallException already specified the InterfaceType attribute. To use InterfaceType elements, omit the InterfaceType attribute."); |
| 33 | } |
| 34 | |
| 35 | public static Message IllegalInterfaceTypeWithInterfaceTypeAll(SourceLineNumber sourceLineNumbers) |
| 36 | { |
| 37 | return Message(sourceLineNumbers, Ids.IllegalInterfaceTypeWithInterfaceTypeAll, "The InterfaceType element cannot be specified because its parent FirewallException contains another InterfaceType element with value 'All'."); |
| 38 | } |
| 39 | public static Message IllegalLocalAddressWithLocalScopeAttribute(SourceLineNumber sourceLineNumbers) |
| 40 | { |
| 41 | return Message(sourceLineNumbers, Ids.IllegalLocalAddressWithLocalScopeAttribute, "The LocalAddress element cannot be specified because its parent FirewallException already specified the LocalScope attribute. To use LocalAddress elements, omit the LocalScope attribute."); |
| 42 | } |
| 43 | |
| 44 | public enum Ids |
| 45 | { |
| 46 | IllegalRemoteAddressWithScopeAttribute = 6401, |
| 47 | IllegalInterfaceWithInterfaceAttribute = 6402, |
| 48 | IllegalInterfaceTypeWithInterfaceTypeAttribute = 6404, |
| 49 | IllegalInterfaceTypeWithInterfaceTypeAll = 6405, |
| 50 | IllegalLocalAddressWithLocalScopeAttribute = 6406, |
| 51 | } |
| 52 | } |
| 53 | } |