diff options
author | Rob Mensching <rob@firegiant.com> | 2018-08-01 03:02:34 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2018-08-01 03:02:34 -0700 |
commit | 52005c7e6917f9866dd0b0de6993def16a72ed4b (patch) | |
tree | 59e32ad17a3ca5915c4cddbeaa83b58a73f0c3a5 /src/WixToolset.Core | |
parent | 79473d778b6cc4c8eec93b92e3b244aed904dac1 (diff) | |
download | wix-52005c7e6917f9866dd0b0de6993def16a72ed4b.tar.gz wix-52005c7e6917f9866dd0b0de6993def16a72ed4b.tar.bz2 wix-52005c7e6917f9866dd0b0de6993def16a72ed4b.zip |
Major reduction in public surface area of WixToolset.Core
Diffstat (limited to 'src/WixToolset.Core')
38 files changed, 110 insertions, 220 deletions
diff --git a/src/WixToolset.Core/Bind/FileFacade.cs b/src/WixToolset.Core/Bind/FileFacade.cs index ebca9cff..825c2c7a 100644 --- a/src/WixToolset.Core/Bind/FileFacade.cs +++ b/src/WixToolset.Core/Bind/FileFacade.cs | |||
@@ -21,13 +21,13 @@ namespace WixToolset.Core.Bind | |||
21 | this.WixFile = wixFile; | 21 | this.WixFile = wixFile; |
22 | } | 22 | } |
23 | 23 | ||
24 | public bool FromModule { get; private set; } | 24 | public bool FromModule { get; } |
25 | 25 | ||
26 | public FileTuple File { get; private set; } | 26 | public FileTuple File { get; } |
27 | 27 | ||
28 | public WixFileTuple WixFile { get; private set; } | 28 | public WixFileTuple WixFile { get; } |
29 | 29 | ||
30 | public WixDeltaPatchFileTuple DeltaPatchFile { get; private set; } | 30 | public WixDeltaPatchFileTuple DeltaPatchFile { get; } |
31 | 31 | ||
32 | /// <summary> | 32 | /// <summary> |
33 | /// Gets the set of MsiAssemblyName rows created for this file. | 33 | /// Gets the set of MsiAssemblyName rows created for this file. |
diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs index 12719f51..413be301 100644 --- a/src/WixToolset.Core/BindContext.cs +++ b/src/WixToolset.Core/BindContext.cs | |||
@@ -8,7 +8,7 @@ namespace WixToolset.Core | |||
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
10 | 10 | ||
11 | public class BindContext : IBindContext | 11 | internal class BindContext : IBindContext |
12 | { | 12 | { |
13 | internal BindContext(IServiceProvider serviceProvider) | 13 | internal BindContext(IServiceProvider serviceProvider) |
14 | { | 14 | { |
diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index 2a40ce71..bbc4173b 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs | |||
@@ -16,9 +16,9 @@ namespace WixToolset.Core | |||
16 | /// <summary> | 16 | /// <summary> |
17 | /// Binder of the WiX toolset. | 17 | /// Binder of the WiX toolset. |
18 | /// </summary> | 18 | /// </summary> |
19 | public sealed class Binder | 19 | internal class Binder |
20 | { | 20 | { |
21 | public Binder(IServiceProvider serviceProvider) | 21 | internal Binder(IServiceProvider serviceProvider) |
22 | { | 22 | { |
23 | this.ServiceProvider = serviceProvider; | 23 | this.ServiceProvider = serviceProvider; |
24 | } | 24 | } |
diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 822c4a9a..5c089b5f 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs | |||
@@ -317,6 +317,8 @@ namespace WixToolset.Core.CommandLine | |||
317 | 317 | ||
318 | private IEnumerable<Localization> LoadLocalizationFiles() | 318 | private IEnumerable<Localization> LoadLocalizationFiles() |
319 | { | 319 | { |
320 | var localizer = new Localizer(this.ServiceProvider); | ||
321 | |||
320 | foreach (var loc in this.LocFiles) | 322 | foreach (var loc in this.LocFiles) |
321 | { | 323 | { |
322 | var preprocessor = new Preprocessor(this.ServiceProvider); | 324 | var preprocessor = new Preprocessor(this.ServiceProvider); |
@@ -331,8 +333,7 @@ namespace WixToolset.Core.CommandLine | |||
331 | continue; | 333 | continue; |
332 | } | 334 | } |
333 | 335 | ||
334 | var localization = Localizer.ParseLocalizationFile(this.Messaging, document); | 336 | var localization = localizer.ParseLocalizationFile(document); |
335 | |||
336 | yield return localization; | 337 | yield return localization; |
337 | } | 338 | } |
338 | } | 339 | } |
diff --git a/src/WixToolset.Core/CommandLine/CommandLineResponseFile.cs b/src/WixToolset.Core/CommandLine/CommandLineResponseFile.cs deleted file mode 100644 index 6922b246..00000000 --- a/src/WixToolset.Core/CommandLine/CommandLineResponseFile.cs +++ /dev/null | |||
@@ -1,132 +0,0 @@ | |||
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.CommandLine | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections; | ||
7 | using System.Collections.Generic; | ||
8 | using System.IO; | ||
9 | using System.Text; | ||
10 | using System.Text.RegularExpressions; | ||
11 | |||
12 | /// <summary> | ||
13 | /// Common utilities for Wix command-line processing. | ||
14 | /// </summary> | ||
15 | public static class CommandLineResponseFile | ||
16 | { | ||
17 | /// <summary> | ||
18 | /// Parses a response file. | ||
19 | /// </summary> | ||
20 | /// <param name="responseFile">The file to parse.</param> | ||
21 | /// <returns>The array of arguments.</returns> | ||
22 | public static string[] Parse(string responseFile) | ||
23 | { | ||
24 | string arguments; | ||
25 | |||
26 | using (StreamReader reader = new StreamReader(responseFile)) | ||
27 | { | ||
28 | arguments = reader.ReadToEnd(); | ||
29 | } | ||
30 | |||
31 | return CommandLineResponseFile.ParseArgumentsToArray(arguments); | ||
32 | } | ||
33 | |||
34 | /// <summary> | ||
35 | /// Parses an argument string into an argument array based on whitespace and quoting. | ||
36 | /// </summary> | ||
37 | /// <param name="arguments">Argument string.</param> | ||
38 | /// <returns>Argument array.</returns> | ||
39 | public static string[] ParseArgumentsToArray(string arguments) | ||
40 | { | ||
41 | // Scan and parse the arguments string, dividing up the arguments based on whitespace. | ||
42 | // Unescaped quotes cause whitespace to be ignored, while the quotes themselves are removed. | ||
43 | // Quotes may begin and end inside arguments; they don't necessarily just surround whole arguments. | ||
44 | // Escaped quotes and escaped backslashes also need to be unescaped by this process. | ||
45 | |||
46 | // Collects the final list of arguments to be returned. | ||
47 | List<string> argsList = new List<string>(); | ||
48 | |||
49 | // True if we are inside an unescaped quote, meaning whitespace should be ignored. | ||
50 | bool insideQuote = false; | ||
51 | |||
52 | // Index of the start of the current argument substring; either the start of the argument | ||
53 | // or the start of a quoted or unquoted sequence within it. | ||
54 | int partStart = 0; | ||
55 | |||
56 | // The current argument string being built; when completed it will be added to the list. | ||
57 | StringBuilder arg = new StringBuilder(); | ||
58 | |||
59 | for (int i = 0; i <= arguments.Length; i++) | ||
60 | { | ||
61 | if (i == arguments.Length || (Char.IsWhiteSpace(arguments[i]) && !insideQuote)) | ||
62 | { | ||
63 | // Reached a whitespace separator or the end of the string. | ||
64 | |||
65 | // Finish building the current argument. | ||
66 | arg.Append(arguments.Substring(partStart, i - partStart)); | ||
67 | |||
68 | // Skip over the whitespace character. | ||
69 | partStart = i + 1; | ||
70 | |||
71 | // Add the argument to the list if it's not empty. | ||
72 | if (arg.Length > 0) | ||
73 | { | ||
74 | argsList.Add(CommandLineResponseFile.ExpandEnvVars(arg.ToString())); | ||
75 | arg.Length = 0; | ||
76 | } | ||
77 | } | ||
78 | else if (i > partStart && arguments[i - 1] == '\\') | ||
79 | { | ||
80 | // Check the character following an unprocessed backslash. | ||
81 | // Unescape quotes, and backslashes followed by a quote. | ||
82 | if (arguments[i] == '"' || (arguments[i] == '\\' && arguments.Length > i + 1 && arguments[i + 1] == '"')) | ||
83 | { | ||
84 | // Unescape the quote or backslash by skipping the preceeding backslash. | ||
85 | arg.Append(arguments.Substring(partStart, i - 1 - partStart)); | ||
86 | arg.Append(arguments[i]); | ||
87 | partStart = i + 1; | ||
88 | } | ||
89 | } | ||
90 | else if (arguments[i] == '"') | ||
91 | { | ||
92 | // Add the quoted or unquoted section to the argument string. | ||
93 | arg.Append(arguments.Substring(partStart, i - partStart)); | ||
94 | |||
95 | // And skip over the quote character. | ||
96 | partStart = i + 1; | ||
97 | |||
98 | insideQuote = !insideQuote; | ||
99 | } | ||
100 | } | ||
101 | |||
102 | return argsList.ToArray(); | ||
103 | } | ||
104 | |||
105 | static private string ExpandEnvVars(string arguments) | ||
106 | { | ||
107 | IDictionary id = Environment.GetEnvironmentVariables(); | ||
108 | |||
109 | Regex regex = new Regex("(?<=\\%)(?:[\\w\\.]+)(?=\\%)"); | ||
110 | MatchCollection matches = regex.Matches(arguments); | ||
111 | |||
112 | string value = String.Empty; | ||
113 | for (int i = 0; i <= (matches.Count - 1); i++) | ||
114 | { | ||
115 | try | ||
116 | { | ||
117 | string key = matches[i].Value; | ||
118 | regex = new Regex(String.Concat("(?i)(?:\\%)(?:" , key , ")(?:\\%)")); | ||
119 | value = id[key].ToString(); | ||
120 | arguments = regex.Replace(arguments, value); | ||
121 | } | ||
122 | catch (NullReferenceException) | ||
123 | { | ||
124 | // Collapse unresolved environment variables. | ||
125 | arguments = regex.Replace(arguments, value); | ||
126 | } | ||
127 | } | ||
128 | |||
129 | return arguments; | ||
130 | } | ||
131 | } | ||
132 | } | ||
diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs index 6f19961f..c7a0905e 100644 --- a/src/WixToolset.Core/CompileContext.cs +++ b/src/WixToolset.Core/CompileContext.cs | |||
@@ -9,7 +9,7 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Extensibility; | 9 | using WixToolset.Extensibility; |
10 | using WixToolset.Extensibility.Data; | 10 | using WixToolset.Extensibility.Data; |
11 | 11 | ||
12 | public class CompileContext : ICompileContext | 12 | internal class CompileContext : ICompileContext |
13 | { | 13 | { |
14 | internal CompileContext(IServiceProvider serviceProvider) | 14 | internal CompileContext(IServiceProvider serviceProvider) |
15 | { | 15 | { |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 06f477c1..437c1481 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
@@ -22,7 +22,7 @@ namespace WixToolset.Core | |||
22 | /// <summary> | 22 | /// <summary> |
23 | /// Compiler of the WiX toolset. | 23 | /// Compiler of the WiX toolset. |
24 | /// </summary> | 24 | /// </summary> |
25 | public sealed class Compiler | 25 | internal class Compiler |
26 | { | 26 | { |
27 | public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; | 27 | public const string UpgradeDetectedProperty = "WIX_UPGRADE_DETECTED"; |
28 | public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; | 28 | public const string UpgradePreventedCondition = "NOT WIX_UPGRADE_DETECTED"; |
@@ -69,7 +69,7 @@ namespace WixToolset.Core | |||
69 | Icon, | 69 | Icon, |
70 | } | 70 | } |
71 | 71 | ||
72 | public Compiler(IServiceProvider serviceProvider) | 72 | internal Compiler(IServiceProvider serviceProvider) |
73 | { | 73 | { |
74 | this.ServiceProvider = serviceProvider; | 74 | this.ServiceProvider = serviceProvider; |
75 | 75 | ||
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index c9165b52..cc881f48 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs | |||
@@ -39,7 +39,7 @@ namespace WixToolset.Core | |||
39 | /// <summary> | 39 | /// <summary> |
40 | /// Core class for the compiler. | 40 | /// Core class for the compiler. |
41 | /// </summary> | 41 | /// </summary> |
42 | internal sealed class CompilerCore | 42 | internal class CompilerCore |
43 | { | 43 | { |
44 | internal static readonly XNamespace W3SchemaPrefix = "http://www.w3.org/"; | 44 | internal static readonly XNamespace W3SchemaPrefix = "http://www.w3.org/"; |
45 | internal static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; | 45 | internal static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; |
diff --git a/src/WixToolset.Core/Converter.cs b/src/WixToolset.Core/Converter.cs index fd925f7a..1f83c88f 100644 --- a/src/WixToolset.Core/Converter.cs +++ b/src/WixToolset.Core/Converter.cs | |||
@@ -15,7 +15,7 @@ namespace WixToolset.Core | |||
15 | /// <summary> | 15 | /// <summary> |
16 | /// WiX source code converter. | 16 | /// WiX source code converter. |
17 | /// </summary> | 17 | /// </summary> |
18 | public class Converter | 18 | internal class Converter |
19 | { | 19 | { |
20 | private const string XDocumentNewLine = "\n"; // XDocument normlizes "\r\n" to just "\n". | 20 | private const string XDocumentNewLine = "\n"; // XDocument normlizes "\r\n" to just "\n". |
21 | private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; | 21 | private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs"; |
@@ -65,7 +65,7 @@ namespace WixToolset.Core | |||
65 | /// <param name="indentationAmount">Indentation value to use when validating leading whitespace.</param> | 65 | /// <param name="indentationAmount">Indentation value to use when validating leading whitespace.</param> |
66 | /// <param name="errorsAsWarnings">Test errors to display as warnings.</param> | 66 | /// <param name="errorsAsWarnings">Test errors to display as warnings.</param> |
67 | /// <param name="ignoreErrors">Test errors to ignore.</param> | 67 | /// <param name="ignoreErrors">Test errors to ignore.</param> |
68 | public Converter(IMessaging messaging, int indentationAmount, IEnumerable<string> errorsAsWarnings = null, IEnumerable<string> ignoreErrors = null) | 68 | internal Converter(IMessaging messaging, int indentationAmount, IEnumerable<string> errorsAsWarnings = null, IEnumerable<string> ignoreErrors = null) |
69 | { | 69 | { |
70 | this.ConvertElementMapping = new Dictionary<XName, Action<XElement>>() | 70 | this.ConvertElementMapping = new Dictionary<XName, Action<XElement>>() |
71 | { | 71 | { |
diff --git a/src/WixToolset.Core/Harvester.cs b/src/WixToolset.Core/Harvester.cs index b9c27418..55d56e64 100644 --- a/src/WixToolset.Core/Harvester.cs +++ b/src/WixToolset.Core/Harvester.cs | |||
@@ -11,7 +11,7 @@ namespace WixToolset | |||
11 | /// <summary> | 11 | /// <summary> |
12 | /// The WiX Toolset harvester. | 12 | /// The WiX Toolset harvester. |
13 | /// </summary> | 13 | /// </summary> |
14 | public sealed class Harvester | 14 | public class Harvester |
15 | { | 15 | { |
16 | private HarvesterExtension harvesterExtension; | 16 | private HarvesterExtension harvesterExtension; |
17 | 17 | ||
diff --git a/src/WixToolset.Core/HarvesterCore.cs b/src/WixToolset.Core/HarvesterCore.cs index 92a057d8..70991979 100644 --- a/src/WixToolset.Core/HarvesterCore.cs +++ b/src/WixToolset.Core/HarvesterCore.cs | |||
@@ -10,7 +10,7 @@ namespace WixToolset.Core | |||
10 | /// <summary> | 10 | /// <summary> |
11 | /// The WiX Toolset harvester core. | 11 | /// The WiX Toolset harvester core. |
12 | /// </summary> | 12 | /// </summary> |
13 | public sealed class HarvesterCore : IHarvesterCore | 13 | public class HarvesterCore : IHarvesterCore |
14 | { | 14 | { |
15 | public IMessaging Messaging { get; set; } | 15 | public IMessaging Messaging { get; set; } |
16 | 16 | ||
diff --git a/src/WixToolset.Core/HeatCore.cs b/src/WixToolset.Core/HeatCore.cs index 8e02a7b5..d43b5f3d 100644 --- a/src/WixToolset.Core/HeatCore.cs +++ b/src/WixToolset.Core/HeatCore.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core | |||
7 | /// <summary> | 7 | /// <summary> |
8 | /// The WiX Toolset Harvester application core. | 8 | /// The WiX Toolset Harvester application core. |
9 | /// </summary> | 9 | /// </summary> |
10 | public sealed class HeatCore : IHeatCore | 10 | public class HeatCore : IHeatCore |
11 | { | 11 | { |
12 | private Harvester harvester; | 12 | private Harvester harvester; |
13 | private Mutator mutator; | 13 | private Mutator mutator; |
diff --git a/src/WixToolset.Core/ILocalizer.cs b/src/WixToolset.Core/ILocalizer.cs new file mode 100644 index 00000000..f15d9ba7 --- /dev/null +++ b/src/WixToolset.Core/ILocalizer.cs | |||
@@ -0,0 +1,27 @@ | |||
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.Xml.Linq; | ||
6 | using WixToolset.Data; | ||
7 | |||
8 | /// <summary> | ||
9 | /// Parses localization files and localizes database values. | ||
10 | /// </summary> | ||
11 | public interface ILocalizer | ||
12 | { | ||
13 | /// <summary> | ||
14 | /// Loads a localization file from a path on disk. | ||
15 | /// </summary> | ||
16 | /// <param name="path">Path to localization file saved on disk.</param> | ||
17 | /// <returns>Returns the loaded localization file.</returns> | ||
18 | Localization ParseLocalizationFile(string path); | ||
19 | |||
20 | /// <summary> | ||
21 | /// Loads a localization file from memory. | ||
22 | /// </summary> | ||
23 | /// <param name="document">Document to parse as localization file.</param> | ||
24 | /// <returns>Returns the loaded localization file.</returns> | ||
25 | Localization ParseLocalizationFile(XDocument document); | ||
26 | } | ||
27 | } | ||
diff --git a/src/WixToolset.Core/Inscriber.cs b/src/WixToolset.Core/Inscriber.cs index efe64ad2..649e1661 100644 --- a/src/WixToolset.Core/Inscriber.cs +++ b/src/WixToolset.Core/Inscriber.cs | |||
@@ -1,6 +1,6 @@ | |||
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 | 3 | namespace WixToolset.Core |
4 | { | 4 | { |
5 | using System.IO; | 5 | using System.IO; |
6 | using WixToolset.Data; | 6 | using WixToolset.Data; |
@@ -8,7 +8,7 @@ namespace WixToolset | |||
8 | /// <summary> | 8 | /// <summary> |
9 | /// Converts a wixout representation of an MSM database into a ComponentGroup the form of WiX source. | 9 | /// Converts a wixout representation of an MSM database into a ComponentGroup the form of WiX source. |
10 | /// </summary> | 10 | /// </summary> |
11 | public sealed class Inscriber | 11 | internal class Inscriber |
12 | { | 12 | { |
13 | /// <summary> | 13 | /// <summary> |
14 | /// Gets or sets the temp files collection. | 14 | /// Gets or sets the temp files collection. |
diff --git a/src/WixToolset.Core/Layout.cs b/src/WixToolset.Core/Layout.cs index 28c9d5fc..128efc61 100644 --- a/src/WixToolset.Core/Layout.cs +++ b/src/WixToolset.Core/Layout.cs | |||
@@ -15,9 +15,9 @@ namespace WixToolset.Core | |||
15 | /// <summary> | 15 | /// <summary> |
16 | /// Layout for the WiX toolset. | 16 | /// Layout for the WiX toolset. |
17 | /// </summary> | 17 | /// </summary> |
18 | public sealed class Layout | 18 | internal class Layout |
19 | { | 19 | { |
20 | public Layout(IServiceProvider serviceProvider) | 20 | internal Layout(IServiceProvider serviceProvider) |
21 | { | 21 | { |
22 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | 23 | ||
diff --git a/src/WixToolset.Core/LayoutContext.cs b/src/WixToolset.Core/LayoutContext.cs index 172cea65..99ca611a 100644 --- a/src/WixToolset.Core/LayoutContext.cs +++ b/src/WixToolset.Core/LayoutContext.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Core | |||
7 | using WixToolset.Extensibility; | 7 | using WixToolset.Extensibility; |
8 | using WixToolset.Extensibility.Data; | 8 | using WixToolset.Extensibility.Data; |
9 | 9 | ||
10 | public class LayoutContext : ILayoutContext | 10 | internal class LayoutContext : ILayoutContext |
11 | { | 11 | { |
12 | internal LayoutContext(IServiceProvider serviceProvider) | 12 | internal LayoutContext(IServiceProvider serviceProvider) |
13 | { | 13 | { |
diff --git a/src/WixToolset.Core/Librarian.cs b/src/WixToolset.Core/Librarian.cs index 15efcfcc..abd6c844 100644 --- a/src/WixToolset.Core/Librarian.cs +++ b/src/WixToolset.Core/Librarian.cs | |||
@@ -15,9 +15,9 @@ namespace WixToolset.Core | |||
15 | /// <summary> | 15 | /// <summary> |
16 | /// Core librarian tool. | 16 | /// Core librarian tool. |
17 | /// </summary> | 17 | /// </summary> |
18 | public sealed class Librarian | 18 | internal class Librarian |
19 | { | 19 | { |
20 | public Librarian(IServiceProvider serviceProvider) | 20 | internal Librarian(IServiceProvider serviceProvider) |
21 | { | 21 | { |
22 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | 23 | ||
diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs index 0b09aa93..e61b6ce8 100644 --- a/src/WixToolset.Core/LibraryContext.cs +++ b/src/WixToolset.Core/LibraryContext.cs | |||
@@ -9,9 +9,9 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
11 | 11 | ||
12 | public class LibraryContext : ILibraryContext | 12 | internal class LibraryContext : ILibraryContext |
13 | { | 13 | { |
14 | public LibraryContext(IServiceProvider serviceProvider) | 14 | internal LibraryContext(IServiceProvider serviceProvider) |
15 | { | 15 | { |
16 | this.ServiceProvider = serviceProvider; | 16 | this.ServiceProvider = serviceProvider; |
17 | } | 17 | } |
diff --git a/src/WixToolset.Core/Link/ConnectToFeature.cs b/src/WixToolset.Core/Link/ConnectToFeature.cs index bc85426a..dd95f2db 100644 --- a/src/WixToolset.Core/Link/ConnectToFeature.cs +++ b/src/WixToolset.Core/Link/ConnectToFeature.cs | |||
@@ -1,6 +1,6 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
6 | using WixToolset.Data; | 6 | using WixToolset.Data; |
@@ -8,7 +8,7 @@ namespace WixToolset.Link | |||
8 | /// <summary> | 8 | /// <summary> |
9 | /// Object that connects things (components/modules) to features. | 9 | /// Object that connects things (components/modules) to features. |
10 | /// </summary> | 10 | /// </summary> |
11 | public sealed class ConnectToFeature | 11 | internal class ConnectToFeature |
12 | { | 12 | { |
13 | /// <summary> | 13 | /// <summary> |
14 | /// Creates a new connect to feature. | 14 | /// Creates a new connect to feature. |
diff --git a/src/WixToolset.Core/Link/ConnectToFeatureCollection.cs b/src/WixToolset.Core/Link/ConnectToFeatureCollection.cs index 8dd0d22c..b7874527 100644 --- a/src/WixToolset.Core/Link/ConnectToFeatureCollection.cs +++ b/src/WixToolset.Core/Link/ConnectToFeatureCollection.cs | |||
@@ -1,6 +1,6 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections; | 6 | using System.Collections; |
@@ -8,7 +8,7 @@ namespace WixToolset.Link | |||
8 | /// <summary> | 8 | /// <summary> |
9 | /// Hash collection of connect to feature objects. | 9 | /// Hash collection of connect to feature objects. |
10 | /// </summary> | 10 | /// </summary> |
11 | public sealed class ConnectToFeatureCollection : ICollection | 11 | internal class ConnectToFeatureCollection : ICollection |
12 | { | 12 | { |
13 | private Hashtable collection; | 13 | private Hashtable collection; |
14 | 14 | ||
diff --git a/src/WixToolset.Core/Link/ConnectToModule.cs b/src/WixToolset.Core/Link/ConnectToModule.cs index d6a8338e..4380e12c 100644 --- a/src/WixToolset.Core/Link/ConnectToModule.cs +++ b/src/WixToolset.Core/Link/ConnectToModule.cs | |||
@@ -1,11 +1,11 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | /// <summary> | 5 | /// <summary> |
6 | /// Object that connects things to modules. | 6 | /// Object that connects things to modules. |
7 | /// </summary> | 7 | /// </summary> |
8 | public sealed class ConnectToModule | 8 | internal class ConnectToModule |
9 | { | 9 | { |
10 | private string childId; | 10 | private string childId; |
11 | private string module; | 11 | private string module; |
diff --git a/src/WixToolset.Core/Link/ConnectToModuleCollection.cs b/src/WixToolset.Core/Link/ConnectToModuleCollection.cs index 6595487f..e0f96ffb 100644 --- a/src/WixToolset.Core/Link/ConnectToModuleCollection.cs +++ b/src/WixToolset.Core/Link/ConnectToModuleCollection.cs | |||
@@ -1,6 +1,6 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections; | 6 | using System.Collections; |
@@ -8,7 +8,7 @@ namespace WixToolset.Link | |||
8 | /// <summary> | 8 | /// <summary> |
9 | /// Hash collection of connect to module objects. | 9 | /// Hash collection of connect to module objects. |
10 | /// </summary> | 10 | /// </summary> |
11 | public sealed class ConnectToModuleCollection : ICollection | 11 | internal class ConnectToModuleCollection : ICollection |
12 | { | 12 | { |
13 | private Hashtable collection; | 13 | private Hashtable collection; |
14 | 14 | ||
diff --git a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs index 23fac864..8d818ad9 100644 --- a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs | |||
@@ -1,13 +1,13 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | using System.Collections.Generic; | 5 | using System.Collections.Generic; |
6 | using System.Linq; | 6 | using System.Linq; |
7 | using WixToolset.Data; | 7 | using WixToolset.Data; |
8 | using WixToolset.Extensibility.Services; | 8 | using WixToolset.Extensibility.Services; |
9 | 9 | ||
10 | public class ReportConflictingSymbolsCommand | 10 | internal class ReportConflictingSymbolsCommand |
11 | { | 11 | { |
12 | public ReportConflictingSymbolsCommand(IMessaging messaging, IEnumerable<Symbol> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) | 12 | public ReportConflictingSymbolsCommand(IMessaging messaging, IEnumerable<Symbol> possibleConflicts, IEnumerable<IntermediateSection> resolvedSections) |
13 | { | 13 | { |
diff --git a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs index c05464e9..0188f9ac 100644 --- a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs +++ b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs | |||
@@ -1,6 +1,6 @@ | |||
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.Link | 3 | namespace WixToolset.Core.Link |
4 | { | 4 | { |
5 | using System; | 5 | using System; |
6 | using System.Collections.Generic; | 6 | using System.Collections.Generic; |
diff --git a/src/WixToolset.Core/Link/WixGroupingOrdering.cs b/src/WixToolset.Core/Link/WixGroupingOrdering.cs index 50c4d8d2..4e89e607 100644 --- a/src/WixToolset.Core/Link/WixGroupingOrdering.cs +++ b/src/WixToolset.Core/Link/WixGroupingOrdering.cs | |||
@@ -16,7 +16,7 @@ namespace WixToolset.Core.Link | |||
16 | /// <summary> | 16 | /// <summary> |
17 | /// Grouping and Ordering class of the WiX toolset. | 17 | /// Grouping and Ordering class of the WiX toolset. |
18 | /// </summary> | 18 | /// </summary> |
19 | internal sealed class WixGroupingOrdering | 19 | internal class WixGroupingOrdering |
20 | { | 20 | { |
21 | private IMessaging messageHandler; | 21 | private IMessaging messageHandler; |
22 | private List<string> groupTypes; | 22 | private List<string> groupTypes; |
@@ -679,7 +679,7 @@ namespace WixToolset.Core.Link | |||
679 | /// <summary> | 679 | /// <summary> |
680 | /// Helper IComparer class to make ordering easier. | 680 | /// Helper IComparer class to make ordering easier. |
681 | /// </summary> | 681 | /// </summary> |
682 | internal sealed class AfterItemComparer : IComparer<Item> | 682 | internal class AfterItemComparer : IComparer<Item> |
683 | { | 683 | { |
684 | public int Compare(Item x, Item y) | 684 | public int Compare(Item x, Item y) |
685 | { | 685 | { |
diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs index 7576ca3f..f45a3411 100644 --- a/src/WixToolset.Core/LinkContext.cs +++ b/src/WixToolset.Core/LinkContext.cs | |||
@@ -8,7 +8,7 @@ namespace WixToolset.Core | |||
8 | using WixToolset.Extensibility; | 8 | using WixToolset.Extensibility; |
9 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
10 | 10 | ||
11 | public class LinkContext : ILinkContext | 11 | internal class LinkContext : ILinkContext |
12 | { | 12 | { |
13 | internal LinkContext(IServiceProvider serviceProvider) | 13 | internal LinkContext(IServiceProvider serviceProvider) |
14 | { | 14 | { |
diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs index 4d1a6965..04188e53 100644 --- a/src/WixToolset.Core/Linker.cs +++ b/src/WixToolset.Core/Linker.cs | |||
@@ -14,12 +14,11 @@ namespace WixToolset.Core | |||
14 | using WixToolset.Extensibility; | 14 | using WixToolset.Extensibility; |
15 | using WixToolset.Extensibility.Data; | 15 | using WixToolset.Extensibility.Data; |
16 | using WixToolset.Extensibility.Services; | 16 | using WixToolset.Extensibility.Services; |
17 | using WixToolset.Link; | ||
18 | 17 | ||
19 | /// <summary> | 18 | /// <summary> |
20 | /// Linker core of the WiX toolset. | 19 | /// Linker core of the WiX toolset. |
21 | /// </summary> | 20 | /// </summary> |
22 | public sealed class Linker | 21 | internal class Linker |
23 | { | 22 | { |
24 | private static readonly char[] colonCharacter = ":".ToCharArray(); | 23 | private static readonly char[] colonCharacter = ":".ToCharArray(); |
25 | private static readonly string emptyGuid = Guid.Empty.ToString("B"); | 24 | private static readonly string emptyGuid = Guid.Empty.ToString("B"); |
@@ -29,7 +28,7 @@ namespace WixToolset.Core | |||
29 | /// <summary> | 28 | /// <summary> |
30 | /// Creates a linker. | 29 | /// Creates a linker. |
31 | /// </summary> | 30 | /// </summary> |
32 | public Linker(IServiceProvider serviceProvider) | 31 | internal Linker(IServiceProvider serviceProvider) |
33 | { | 32 | { |
34 | this.ServiceProvider = serviceProvider; | 33 | this.ServiceProvider = serviceProvider; |
35 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); | 34 | this.Messaging = this.ServiceProvider.GetService<IMessaging>(); |
diff --git a/src/WixToolset.Core/Localizer.cs b/src/WixToolset.Core/Localizer.cs index cb9a4406..a545f844 100644 --- a/src/WixToolset.Core/Localizer.cs +++ b/src/WixToolset.Core/Localizer.cs | |||
@@ -11,31 +11,25 @@ namespace WixToolset.Core | |||
11 | using WixToolset.Extensibility; | 11 | using WixToolset.Extensibility; |
12 | using WixToolset.Extensibility.Services; | 12 | using WixToolset.Extensibility.Services; |
13 | 13 | ||
14 | /// <summary> | 14 | internal class Localizer : ILocalizer |
15 | /// Parses localization files and localizes database values. | ||
16 | /// </summary> | ||
17 | public sealed class Localizer | ||
18 | { | 15 | { |
19 | public static readonly XNamespace WxlNamespace = "http://wixtoolset.org/schemas/v4/wxl"; | 16 | public static readonly XNamespace WxlNamespace = "http://wixtoolset.org/schemas/v4/wxl"; |
20 | private static string XmlElementName = "WixLocalization"; | 17 | private static string XmlElementName = "WixLocalization"; |
21 | 18 | ||
22 | /// <summary> | 19 | internal Localizer(IServiceProvider serviceProvider) |
23 | /// Loads a localization file from a path on disk. | 20 | { |
24 | /// </summary> | 21 | this.Messaging = serviceProvider.GetService<IMessaging>(); |
25 | /// <param name="path">Path to localization file saved on disk.</param> | 22 | } |
26 | /// <returns>Returns the loaded localization file.</returns> | 23 | |
27 | public static Localization ParseLocalizationFile(IMessaging messaging, string path) | 24 | private IMessaging Messaging { get; } |
25 | |||
26 | public Localization ParseLocalizationFile(string path) | ||
28 | { | 27 | { |
29 | var document = XDocument.Load(path); | 28 | var document = XDocument.Load(path); |
30 | return ParseLocalizationFile(messaging, document); | 29 | return ParseLocalizationFile(document); |
31 | } | 30 | } |
32 | 31 | ||
33 | /// <summary> | 32 | public Localization ParseLocalizationFile(XDocument document) |
34 | /// Loads a localization file from memory. | ||
35 | /// </summary> | ||
36 | /// <param name="document">Document to parse as localization file.</param> | ||
37 | /// <returns>Returns the loaded localization file.</returns> | ||
38 | public static Localization ParseLocalizationFile(IMessaging messaging, XDocument document) | ||
39 | { | 33 | { |
40 | XElement root = document.Root; | 34 | XElement root = document.Root; |
41 | Localization localization = null; | 35 | Localization localization = null; |
@@ -45,23 +39,23 @@ namespace WixToolset.Core | |||
45 | { | 39 | { |
46 | if (Localizer.WxlNamespace == root.Name.Namespace) | 40 | if (Localizer.WxlNamespace == root.Name.Namespace) |
47 | { | 41 | { |
48 | localization = ParseWixLocalizationElement(messaging, root); | 42 | localization = ParseWixLocalizationElement(this.Messaging, root); |
49 | } | 43 | } |
50 | else // invalid or missing namespace | 44 | else // invalid or missing namespace |
51 | { | 45 | { |
52 | if (null == root.Name.Namespace) | 46 | if (null == root.Name.Namespace) |
53 | { | 47 | { |
54 | messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, Localizer.WxlNamespace.NamespaceName)); | 48 | this.Messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, Localizer.WxlNamespace.NamespaceName)); |
55 | } | 49 | } |
56 | else | 50 | else |
57 | { | 51 | { |
58 | messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, root.Name.LocalName, Localizer.WxlNamespace.NamespaceName)); | 52 | this.Messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, root.Name.LocalName, Localizer.WxlNamespace.NamespaceName)); |
59 | } | 53 | } |
60 | } | 54 | } |
61 | } | 55 | } |
62 | else | 56 | else |
63 | { | 57 | { |
64 | messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, root.Name.LocalName, "localization", Localizer.XmlElementName)); | 58 | this.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, root.Name.LocalName, "localization", Localizer.XmlElementName)); |
65 | } | 59 | } |
66 | 60 | ||
67 | return localization; | 61 | return localization; |
diff --git a/src/WixToolset.Core/Mutator.cs b/src/WixToolset.Core/Mutator.cs index 7f1af13a..cee17736 100644 --- a/src/WixToolset.Core/Mutator.cs +++ b/src/WixToolset.Core/Mutator.cs | |||
@@ -10,7 +10,7 @@ namespace WixToolset.Core | |||
10 | /// <summary> | 10 | /// <summary> |
11 | /// The WiX Toolset mutator. | 11 | /// The WiX Toolset mutator. |
12 | /// </summary> | 12 | /// </summary> |
13 | public sealed class Mutator | 13 | public class Mutator |
14 | { | 14 | { |
15 | private SortedList extensions; | 15 | private SortedList extensions; |
16 | private string extensionArgument; | 16 | private string extensionArgument; |
diff --git a/src/WixToolset.Core/OptimizeCA.cs b/src/WixToolset.Core/OptimizeCA.cs index efd07299..ba17604d 100644 --- a/src/WixToolset.Core/OptimizeCA.cs +++ b/src/WixToolset.Core/OptimizeCA.cs | |||
@@ -8,7 +8,7 @@ namespace WixToolset.Core | |||
8 | /// Values for the OptimizeCA MsiPatchMetdata property, which indicates whether custom actions can be skipped when applying the patch. | 8 | /// Values for the OptimizeCA MsiPatchMetdata property, which indicates whether custom actions can be skipped when applying the patch. |
9 | /// </summary> | 9 | /// </summary> |
10 | [Flags] | 10 | [Flags] |
11 | public enum OptimizeCA | 11 | internal enum OptimizeCA |
12 | { | 12 | { |
13 | /// <summary> | 13 | /// <summary> |
14 | /// No custom actions are skipped. | 14 | /// No custom actions are skipped. |
diff --git a/src/WixToolset.Core/Preprocess/IfContext.cs b/src/WixToolset.Core/Preprocess/IfContext.cs index e7c6e6f5..91173c29 100644 --- a/src/WixToolset.Core/Preprocess/IfContext.cs +++ b/src/WixToolset.Core/Preprocess/IfContext.cs | |||
@@ -5,7 +5,7 @@ namespace WixToolset.Core.Preprocess | |||
5 | /// <summary> | 5 | /// <summary> |
6 | /// Context for an if statement in the preprocessor. | 6 | /// Context for an if statement in the preprocessor. |
7 | /// </summary> | 7 | /// </summary> |
8 | internal sealed class IfContext | 8 | internal class IfContext |
9 | { | 9 | { |
10 | private bool keep; | 10 | private bool keep; |
11 | 11 | ||
diff --git a/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs b/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs index 434590d2..b2a4ddb1 100644 --- a/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs +++ b/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs | |||
@@ -32,12 +32,12 @@ namespace WixToolset.Core.Preprocess | |||
32 | /// Gets the full path of the source file. | 32 | /// Gets the full path of the source file. |
33 | /// </summary> | 33 | /// </summary> |
34 | /// <value>The full path of the source file.</value> | 34 | /// <value>The full path of the source file.</value> |
35 | public string SourceFile { get; private set; } | 35 | public string SourceFile { get; } |
36 | 36 | ||
37 | /// <summary> | 37 | /// <summary> |
38 | /// Gets the preprocessed output stream. | 38 | /// Gets the preprocessed output stream. |
39 | /// </summary> | 39 | /// </summary> |
40 | /// <value>The the preprocessed output stream.</value> | 40 | /// <value>The the preprocessed output stream.</value> |
41 | public XDocument Document { get; private set; } | 41 | public XDocument Document { get; } |
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/src/WixToolset.Core/Preprocessor.cs b/src/WixToolset.Core/Preprocessor.cs index aca954bd..acba0b5f 100644 --- a/src/WixToolset.Core/Preprocessor.cs +++ b/src/WixToolset.Core/Preprocessor.cs | |||
@@ -20,24 +20,24 @@ namespace WixToolset.Core | |||
20 | /// <summary> | 20 | /// <summary> |
21 | /// Preprocessor object | 21 | /// Preprocessor object |
22 | /// </summary> | 22 | /// </summary> |
23 | public sealed class Preprocessor | 23 | internal class Preprocessor |
24 | { | 24 | { |
25 | private readonly Regex defineRegex = new Regex(@"^\s*(?<varName>.+?)\s*(=\s*(?<varValue>.+?)\s*)?$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture); | 25 | private static readonly Regex DefineRegex = new Regex(@"^\s*(?<varName>.+?)\s*(=\s*(?<varValue>.+?)\s*)?$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture); |
26 | private readonly Regex pragmaRegex = new Regex(@"^\s*(?<pragmaName>.+?)(?<pragmaValue>[\s\(].+?)?$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture); | 26 | private static readonly Regex PragmaRegex = new Regex(@"^\s*(?<pragmaName>.+?)(?<pragmaValue>[\s\(].+?)?$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.ExplicitCapture); |
27 | 27 | ||
28 | private readonly XmlReaderSettings DocumentXmlReaderSettings = new XmlReaderSettings() | 28 | private static readonly XmlReaderSettings DocumentXmlReaderSettings = new XmlReaderSettings() |
29 | { | 29 | { |
30 | ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.None, | 30 | ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.None, |
31 | XmlResolver = null, | 31 | XmlResolver = null, |
32 | }; | 32 | }; |
33 | private readonly XmlReaderSettings FragmentXmlReaderSettings = new XmlReaderSettings() | 33 | private static readonly XmlReaderSettings FragmentXmlReaderSettings = new XmlReaderSettings() |
34 | { | 34 | { |
35 | ConformanceLevel = ConformanceLevel.Fragment, | 35 | ConformanceLevel = ConformanceLevel.Fragment, |
36 | ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.None, | 36 | ValidationFlags = System.Xml.Schema.XmlSchemaValidationFlags.None, |
37 | XmlResolver = null, | 37 | XmlResolver = null, |
38 | }; | 38 | }; |
39 | 39 | ||
40 | public Preprocessor(IServiceProvider serviceProvider) | 40 | internal Preprocessor(IServiceProvider serviceProvider) |
41 | { | 41 | { |
42 | this.ServiceProvider = serviceProvider; | 42 | this.ServiceProvider = serviceProvider; |
43 | 43 | ||
@@ -584,7 +584,7 @@ namespace WixToolset.Core | |||
584 | /// <param name="originalDefine">Text from source.</param> | 584 | /// <param name="originalDefine">Text from source.</param> |
585 | private void PreprocessDefine(string originalDefine) | 585 | private void PreprocessDefine(string originalDefine) |
586 | { | 586 | { |
587 | var match = defineRegex.Match(originalDefine); | 587 | var match = DefineRegex.Match(originalDefine); |
588 | 588 | ||
589 | if (!match.Success) | 589 | if (!match.Success) |
590 | { | 590 | { |
@@ -791,7 +791,7 @@ namespace WixToolset.Core | |||
791 | /// <param name="pragmaText">Text from source.</param> | 791 | /// <param name="pragmaText">Text from source.</param> |
792 | private void PreprocessPragma(string pragmaText, XContainer parent) | 792 | private void PreprocessPragma(string pragmaText, XContainer parent) |
793 | { | 793 | { |
794 | var match = pragmaRegex.Match(pragmaText); | 794 | var match = PragmaRegex.Match(pragmaText); |
795 | 795 | ||
796 | if (!match.Success) | 796 | if (!match.Success) |
797 | { | 797 | { |
diff --git a/src/WixToolset.Core/ResolveContext.cs b/src/WixToolset.Core/ResolveContext.cs index 65b991ea..cadc6678 100644 --- a/src/WixToolset.Core/ResolveContext.cs +++ b/src/WixToolset.Core/ResolveContext.cs | |||
@@ -9,7 +9,7 @@ namespace WixToolset.Core | |||
9 | using WixToolset.Extensibility.Data; | 9 | using WixToolset.Extensibility.Data; |
10 | using WixToolset.Extensibility.Services; | 10 | using WixToolset.Extensibility.Services; |
11 | 11 | ||
12 | public class ResolveContext : IResolveContext | 12 | internal class ResolveContext : IResolveContext |
13 | { | 13 | { |
14 | internal ResolveContext(IServiceProvider serviceProvider) | 14 | internal ResolveContext(IServiceProvider serviceProvider) |
15 | { | 15 | { |
diff --git a/src/WixToolset.Core/Resolver.cs b/src/WixToolset.Core/Resolver.cs index 5e283f2c..12cb375b 100644 --- a/src/WixToolset.Core/Resolver.cs +++ b/src/WixToolset.Core/Resolver.cs | |||
@@ -15,9 +15,9 @@ namespace WixToolset.Core | |||
15 | /// <summary> | 15 | /// <summary> |
16 | /// Resolver for the WiX toolset. | 16 | /// Resolver for the WiX toolset. |
17 | /// </summary> | 17 | /// </summary> |
18 | public sealed class Resolver | 18 | internal class Resolver |
19 | { | 19 | { |
20 | public Resolver(IServiceProvider serviceProvider) | 20 | internal Resolver(IServiceProvider serviceProvider) |
21 | { | 21 | { |
22 | this.ServiceProvider = serviceProvider; | 22 | this.ServiceProvider = serviceProvider; |
23 | 23 | ||
@@ -26,7 +26,7 @@ namespace WixToolset.Core | |||
26 | 26 | ||
27 | private IServiceProvider ServiceProvider { get; } | 27 | private IServiceProvider ServiceProvider { get; } |
28 | 28 | ||
29 | public IMessaging Messaging { get; } | 29 | private IMessaging Messaging { get; } |
30 | 30 | ||
31 | public IEnumerable<BindPath> BindPaths { get; set; } | 31 | public IEnumerable<BindPath> BindPaths { get; set; } |
32 | 32 | ||
diff --git a/src/WixToolset.Core/SourceFile.cs b/src/WixToolset.Core/SourceFile.cs index f1064513..d7ea7a50 100644 --- a/src/WixToolset.Core/SourceFile.cs +++ b/src/WixToolset.Core/SourceFile.cs | |||
@@ -2,8 +2,6 @@ | |||
2 | 2 | ||
3 | namespace WixToolset.Core | 3 | namespace WixToolset.Core |
4 | { | 4 | { |
5 | using System.IO; | ||
6 | |||
7 | internal class SourceFile | 5 | internal class SourceFile |
8 | { | 6 | { |
9 | public SourceFile(string sourcePath, string outputPath) | 7 | public SourceFile(string sourcePath, string outputPath) |
@@ -12,8 +10,8 @@ namespace WixToolset.Core | |||
12 | this.OutputPath = outputPath; | 10 | this.OutputPath = outputPath; |
13 | } | 11 | } |
14 | 12 | ||
15 | public string OutputPath { get; set; } | 13 | public string OutputPath { get; } |
16 | 14 | ||
17 | public string SourcePath { get; set; } | 15 | public string SourcePath { get; } |
18 | } | 16 | } |
19 | } | 17 | } |
diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs index ffcdbdd1..9278ddc3 100644 --- a/src/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs | |||
@@ -10,7 +10,7 @@ namespace WixToolset.Core | |||
10 | using WixToolset.Extensibility.Data; | 10 | using WixToolset.Extensibility.Data; |
11 | using WixToolset.Extensibility.Services; | 11 | using WixToolset.Extensibility.Services; |
12 | 12 | ||
13 | public class WixToolsetServiceProvider : IServiceProvider | 13 | public sealed class WixToolsetServiceProvider : IServiceProvider |
14 | { | 14 | { |
15 | public WixToolsetServiceProvider() | 15 | public WixToolsetServiceProvider() |
16 | { | 16 | { |
@@ -36,6 +36,9 @@ namespace WixToolset.Core | |||
36 | { typeof(IBindContext), (provider, singletons) => new BindContext(provider) }, | 36 | { typeof(IBindContext), (provider, singletons) => new BindContext(provider) }, |
37 | { typeof(ILayoutContext), (provider, singletons) => new LayoutContext(provider) }, | 37 | { typeof(ILayoutContext), (provider, singletons) => new LayoutContext(provider) }, |
38 | { typeof(IInscribeContext), (provider, singletons) => new InscribeContext(provider) }, | 38 | { typeof(IInscribeContext), (provider, singletons) => new InscribeContext(provider) }, |
39 | |||
40 | // Internal implementations. | ||
41 | { typeof(ILocalizer), (provider, singletons) => new Localizer(provider) }, | ||
39 | }; | 42 | }; |
40 | 43 | ||
41 | this.Singletons = new Dictionary<Type, object>(); | 44 | this.Singletons = new Dictionary<Type, object>(); |
diff --git a/src/WixToolset.Core/WixVariableResolver.cs b/src/WixToolset.Core/WixVariableResolver.cs index 8ac35e99..75851a56 100644 --- a/src/WixToolset.Core/WixVariableResolver.cs +++ b/src/WixToolset.Core/WixVariableResolver.cs | |||
@@ -12,7 +12,7 @@ namespace WixToolset.Core | |||
12 | /// <summary> | 12 | /// <summary> |
13 | /// WiX variable resolver. | 13 | /// WiX variable resolver. |
14 | /// </summary> | 14 | /// </summary> |
15 | internal sealed class WixVariableResolver : IVariableResolver | 15 | internal class WixVariableResolver : IVariableResolver |
16 | { | 16 | { |
17 | private readonly Dictionary<string, BindVariable> locVariables; | 17 | private readonly Dictionary<string, BindVariable> locVariables; |
18 | private readonly Dictionary<string, BindVariable> wixVariables; | 18 | private readonly Dictionary<string, BindVariable> wixVariables; |