@joebigelow / wix-1 / commits / 528b13ce

Rename IBindVariableResolver to IVariableResolve and merge ILocalizer plus improve IResolveContext

Rob Mensching committed Dec 30, 2017 at 17:05 UTC 528b13ce4ccd3a585c6f4caea0ce6ff0962b7310
5 files changed +53 -34
src/WixToolset.Extensibility/ILocalizer.cs deleted
-15
@@ -1,15 +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.Extensibility
4 -{
5 - using WixToolset.Data;
6 -
7 - public interface ILocalizer
8 - {
9 - int Codepage { get; }
10 -
11 - string GetLocalizedValue(string id);
12 -
13 - LocalizedControl GetLocalizedControl(string dialog, string control);
14 - }
15 -}
src/WixToolset.Extensibility/IResolveContext.cs
+5 -1
@@ -17,10 +17,14 @@ namespace WixToolset.Extensibility
17
18 IEnumerable<IResolverExtension> Extensions { get; set; }
19
20 + IEnumerable<IExtensionData> ExtensionData { get; set; }
21 +
22 string IntermediateFolder { get; set; }
23
24 Intermediate IntermediateRepresentation { get; set; }
25
24 - IBindVariableResolver WixVariableResolver { get; set; }
26 + IEnumerable<Localization> Localizations { get; set; }
27 +
28 + IVariableResolver VariableResolver { get; set; }
29 }
30 }
src/WixToolset.Extensibility/Services/IBindVariableResolver.cs deleted
-17
@@ -1,17 +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.Extensibility.Services
4 -{
5 - using WixToolset.Data;
6 -
7 - public interface IBindVariableResolver
8 - {
9 - int VariableCount { get; }
10 -
11 - void AddVariable(string name, string value, bool overridable);
12 -
13 - BindVariableResolution ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly);
14 -
15 - bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl);
16 - }
17 -}
src/WixToolset.Extensibility/Services/IVariableResolver.cs new
+47
@@ -0,0 +1,47 @@
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.Extensibility.Services
4 +{
5 + using WixToolset.Data;
6 +
7 + public interface IVariableResolver
8 + {
9 + /// <summary>
10 + /// Gets the codepage.
11 + /// </summary>
12 + int Codepage { get; }
13 +
14 + /// <summary>
15 + /// Gets the count of variables added to the resolver.
16 + /// </summary>
17 + int VariableCount { get; }
18 +
19 + void AddLocalization(Localization localization);
20 +
21 + /// <summary>
22 + /// Add a variable.
23 + /// </summary>
24 + /// <param name="name">The name of the variable.</param>
25 + /// <param name="value">The value of the variable.</param>
26 + /// <param name="overridable">Indicates whether the variable can be overridden by an existing variable.</param>
27 + void AddVariable(SourceLineNumber sourceLineNumber, string name, string value, bool overridable);
28 +
29 + /// <summary>
30 + /// Resolve the wix variables in a value.
31 + /// </summary>
32 + /// <param name="sourceLineNumbers">The source line information for the value.</param>
33 + /// <param name="value">The value to resolve.</param>
34 + /// <param name="localizationOnly">true to only resolve localization variables; false otherwise.</param>
35 + /// <returns>The resolved result.</returns>
36 + VariableResolution ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool localizationOnly);
37 +
38 + /// <summary>
39 + /// Try to find localization information for dialog and (optional) control.
40 + /// </summary>
41 + /// <param name="dialog">Dialog identifier.</param>
42 + /// <param name="control">Optional control identifier.</param>
43 + /// <param name="localizedControl">Found localization information.</param>
44 + /// <returns>True if localized control was found, otherwise false.</returns>
45 + bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl);
46 + }
47 +}
src/WixToolset.Extensibility/Services/VariableResolution.cs renamed
+1 -1
@@ -2,7 +2,7 @@
2
3 namespace WixToolset.Extensibility.Services
4 {
5 - public class BindVariableResolution
5 + public class VariableResolution
6 {
7 /// <summary>
8 /// Indicates whether the variable should be delay resolved.