aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/WixVariableResolver.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/WixVariableResolver.cs')
-rw-r--r--src/WixToolset.Core/WixVariableResolver.cs20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/WixToolset.Core/WixVariableResolver.cs b/src/WixToolset.Core/WixVariableResolver.cs
index 921ff1e3..d437423c 100644
--- a/src/WixToolset.Core/WixVariableResolver.cs
+++ b/src/WixToolset.Core/WixVariableResolver.cs
@@ -3,7 +3,6 @@
3namespace WixToolset 3namespace WixToolset
4{ 4{
5 using System; 5 using System;
6 using System.Collections;
7 using System.Collections.Generic; 6 using System.Collections.Generic;
8 using System.Diagnostics.CodeAnalysis; 7 using System.Diagnostics.CodeAnalysis;
9 using System.Globalization; 8 using System.Globalization;
@@ -17,34 +16,27 @@ namespace WixToolset
17 /// </summary> 16 /// </summary>
18 public sealed class WixVariableResolver 17 public sealed class WixVariableResolver
19 { 18 {
20 private Localizer localizer;
21 private Dictionary<string, string> wixVariables; 19 private Dictionary<string, string> wixVariables;
22 20
23 /// <summary> 21 /// <summary>
24 /// Instantiate a new WixVariableResolver. 22 /// Instantiate a new WixVariableResolver.
25 /// </summary> 23 /// </summary>
26 public WixVariableResolver() 24 public WixVariableResolver(Localizer localizer = null)
27 { 25 {
28 this.wixVariables = new Dictionary<string, string>(); 26 this.wixVariables = new Dictionary<string, string>();
27 this.Localizer = localizer;
29 } 28 }
30 29
31 /// <summary> 30 /// <summary>
32 /// Gets or sets the localizer. 31 /// Gets or sets the localizer.
33 /// </summary> 32 /// </summary>
34 /// <value>The localizer.</value> 33 /// <value>The localizer.</value>
35 public Localizer Localizer 34 public Localizer Localizer { get; private set; }
36 {
37 get { return this.localizer; }
38 set { this.localizer = value; }
39 }
40 35
41 /// <summary> 36 /// <summary>
42 /// Gets the count of variables added to the resolver. 37 /// Gets the count of variables added to the resolver.
43 /// </summary> 38 /// </summary>
44 public int VariableCount 39 public int VariableCount => this.wixVariables.Count;
45 {
46 get { return this.wixVariables.Count; }
47 }
48 40
49 /// <summary> 41 /// <summary>
50 /// Add a variable. 42 /// Add a variable.
@@ -198,9 +190,9 @@ namespace WixToolset
198 Messaging.Instance.OnMessage(WixWarnings.DeprecatedLocalizationVariablePrefix(sourceLineNumbers, variableId)); 190 Messaging.Instance.OnMessage(WixWarnings.DeprecatedLocalizationVariablePrefix(sourceLineNumbers, variableId));
199 } 191 }
200 192
201 if (null != this.localizer) 193 if (null != this.Localizer)
202 { 194 {
203 resolvedValue = this.localizer.GetLocalizedValue(variableId); 195 resolvedValue = this.Localizer.GetLocalizedValue(variableId);
204 } 196 }
205 } 197 }
206 else if (!localizationOnly && "wix" == variableNamespace) 198 else if (!localizationOnly && "wix" == variableNamespace)