main
cs 48 lines 2.38 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.Extensibility.Services
4 {
5 using WixToolset.Data;
6
7 #pragma warning disable 1591 // TODO: add documentation
8 public interface IVariableResolver
9 {
10 void AddLocalization(Localization localization);
11 #pragma warning restore 1591
12
13 /// <summary>
14 /// Add a variable.
15 /// </summary>
16 /// <param name="sourceLineNumber">The source line information for the value.</param>
17 /// <param name="name">The name of the variable.</param>
18 /// <param name="value">The value of the variable.</param>
19 /// <param name="overridable">Indicates whether the variable can be overridden by an existing variable.</param>
20 void AddVariable(SourceLineNumber sourceLineNumber, string name, string value, bool overridable);
21
22 /// <summary>
23 /// Resolve the wix variables in a value.
24 /// </summary>
25 /// <param name="sourceLineNumbers">The source line information for the value.</param>
26 /// <param name="value">The value to resolve.</param>
27 /// <returns>The resolved result.</returns>
28 IVariableResolution ResolveVariables(SourceLineNumber sourceLineNumbers, string value);
29
30 /// <summary>
31 /// Resolve the wix variables in a value.
32 /// </summary>
33 /// <param name="sourceLineNumbers">The source line information for the value.</param>
34 /// <param name="value">The value to resolve.</param>
35 /// <param name="errorOnUnknown">true if unknown variables should throw errors.</param>
36 /// <returns>The resolved value.</returns>
37 IVariableResolution ResolveVariables(SourceLineNumber sourceLineNumbers, string value, bool errorOnUnknown);
38
39 /// <summary>
40 /// Try to find localization information for dialog and (optional) control.
41 /// </summary>
42 /// <param name="dialog">Dialog identifier.</param>
43 /// <param name="control">Optional control identifier.</param>
44 /// <param name="localizedControl">Found localization information.</param>
45 /// <returns>True if localized control was found, otherwise false.</returns>
46 bool TryGetLocalizedControl(string dialog, string control, out LocalizedControl localizedControl);
47 }
48 }