diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-12-30 17:05:37 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-12-30 17:05:37 -0800 |
| commit | 528b13ce4ccd3a585c6f4caea0ce6ff0962b7310 (patch) | |
| tree | cdad765843098c79b1ed7dc0713da09f98f81eb3 /src | |
| parent | 5e0736223c10b443c9b4ca9a70148ff1efb8032f (diff) | |
| download | wix-528b13ce4ccd3a585c6f4caea0ce6ff0962b7310.tar.gz wix-528b13ce4ccd3a585c6f4caea0ce6ff0962b7310.tar.bz2 wix-528b13ce4ccd3a585c6f4caea0ce6ff0962b7310.zip | |
Rename IBindVariableResolver to IVariableResolve and merge ILocalizer plus improve IResolveContext
Diffstat (limited to 'src')
| -rw-r--r-- | src/WixToolset.Extensibility/ILocalizer.cs | 15 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/IResolveContext.cs | 6 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/Services/IBindVariableResolver.cs | 17 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/Services/IVariableResolver.cs | 47 | ||||
| -rw-r--r-- | src/WixToolset.Extensibility/Services/VariableResolution.cs (renamed from src/WixToolset.Extensibility/Services/BindVariableResolution.cs) | 2 |
5 files changed, 53 insertions, 34 deletions
diff --git a/src/WixToolset.Extensibility/ILocalizer.cs b/src/WixToolset.Extensibility/ILocalizer.cs deleted file mode 100644 index 3ce29aab..00000000 --- a/src/WixToolset.Extensibility/ILocalizer.cs +++ /dev/null | |||
| @@ -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 | } | ||
diff --git a/src/WixToolset.Extensibility/IResolveContext.cs b/src/WixToolset.Extensibility/IResolveContext.cs index 026e5a35..e03e6689 100644 --- a/src/WixToolset.Extensibility/IResolveContext.cs +++ b/src/WixToolset.Extensibility/IResolveContext.cs | |||
| @@ -17,10 +17,14 @@ namespace WixToolset.Extensibility | |||
| 17 | 17 | ||
| 18 | IEnumerable<IResolverExtension> Extensions { get; set; } | 18 | IEnumerable<IResolverExtension> Extensions { get; set; } |
| 19 | 19 | ||
| 20 | IEnumerable<IExtensionData> ExtensionData { get; set; } | ||
| 21 | |||
| 20 | string IntermediateFolder { get; set; } | 22 | string IntermediateFolder { get; set; } |
| 21 | 23 | ||
| 22 | Intermediate IntermediateRepresentation { get; set; } | 24 | Intermediate IntermediateRepresentation { get; set; } |
| 23 | 25 | ||
| 24 | IBindVariableResolver WixVariableResolver { get; set; } | 26 | IEnumerable<Localization> Localizations { get; set; } |
| 27 | |||
| 28 | IVariableResolver VariableResolver { get; set; } | ||
| 25 | } | 29 | } |
| 26 | } | 30 | } |
diff --git a/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs b/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs deleted file mode 100644 index 50071658..00000000 --- a/src/WixToolset.Extensibility/Services/IBindVariableResolver.cs +++ /dev/null | |||
| @@ -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 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/IVariableResolver.cs b/src/WixToolset.Extensibility/Services/IVariableResolver.cs new file mode 100644 index 00000000..ce11aa81 --- /dev/null +++ b/src/WixToolset.Extensibility/Services/IVariableResolver.cs | |||
| @@ -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 | } | ||
diff --git a/src/WixToolset.Extensibility/Services/BindVariableResolution.cs b/src/WixToolset.Extensibility/Services/VariableResolution.cs index cdd1fa19..2974e84f 100644 --- a/src/WixToolset.Extensibility/Services/BindVariableResolution.cs +++ b/src/WixToolset.Extensibility/Services/VariableResolution.cs | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | namespace WixToolset.Extensibility.Services | 3 | namespace WixToolset.Extensibility.Services |
| 4 | { | 4 | { |
| 5 | public class BindVariableResolution | 5 | public class VariableResolution |
| 6 | { | 6 | { |
| 7 | /// <summary> | 7 | /// <summary> |
| 8 | /// Indicates whether the variable should be delay resolved. | 8 | /// Indicates whether the variable should be delay resolved. |
