main
cs 56 lines 3.63 KB
Raw
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.Core
4 {
5 using System;
6 using WixToolset.Data;
7
8 internal static class CompilerErrors
9 {
10 public static Message AlreadyDefinedBootstrapperApplicationSource(SourceLineNumber sourceLineNumbers, SourceLineNumber originalSourceLineNumbers, string originalElementName)
11 {
12 return Message(sourceLineNumbers, Ids.AlreadyDefinedBootstrapperApplicationSource, "More than one BootstrapperApplication source file was specified. Only one is allowed. Another BootstrapperApplication source file was defined via the {0} element at {1}.", originalElementName, originalSourceLineNumbers.ToString());
13 }
14
15 public static Message IllegalCharactersInProvider(SourceLineNumber sourceLineNumbers, string attributeName, char illegalChar, string illegalChars)
16 {
17 return Message(sourceLineNumbers, Ids.IllegalCharactersInProvider, "The provider key authored into the {0} attribute contains an illegal character, '{1}'. Please author the provider key without any of the following characters: {2}", attributeName, illegalChar, illegalChars);
18 }
19
20 public static Message ReservedValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue)
21 {
22 return Message(sourceLineNumbers, Ids.ReservedValue, "The {0}/@{1} attribute value '{2}' is reserved and cannot be used here. Please choose a different value.", elementName, attributeName, attributeValue);
23 }
24
25 public static Message IllegalBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName,string attributeName, string value)
26 {
27 return Message(sourceLineNumbers, Ids.IllegalBundleVariableName, "The {0}/@{1} attribute's value, '{2}', is not a legal bundle variable name. Identifiers may contain ASCII characters A-Z, a-z, digits, or underscores (_). Every identifier must begin with either a letter or an underscore.", elementName, attributeName, value);
28 }
29
30 public static Message IllegalTagName(SourceLineNumber sourceLineNumbers, string parentElement, string name)
31 {
32 return Message(sourceLineNumbers, Ids.IllegalName, "The Tag/@Name attribute value, '{1}', contains invalid filename identifiers. The Tag/@Name may have defaulted from the {0}/@Name attrbute. If so, use the Tag/@Name attribute to provide a valid filename. Any character except for the follow may be used: \\ ? | > < : / * \".", parentElement, name);
33 }
34
35 public static Message ExampleRegid(SourceLineNumber sourceLineNumbers, string regid)
36 {
37 return Message(sourceLineNumbers, Ids.ExampleRegid, "Regid '{0}' is a placeholder that must be replaced with an appropriate value for your installation. Use the simplified URI for your organization or project.", regid);
38 }
39
40 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
41 {
42 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
43 }
44
45 public enum Ids
46 {
47 IllegalCharactersInProvider = 5400,
48 ReservedValue = 5401,
49
50 IllegalName = 6601,
51 ExampleRegid = 6602,
52 IllegalBundleVariableName = 6603,
53 AlreadyDefinedBootstrapperApplicationSource = 6604,
54 } // 5400-5499 and 6600-6699 were the ranges for Dependency and Tag which are now in Core between CompilerWarnings and CompilerErrors.
55 }
56 }