diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-08-02 08:26:41 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-08-09 10:30:48 -0600 |
commit | 3761d820d9407c0417e7ef26386d9d906e1e5329 (patch) | |
tree | 9d563252714307fab3acc74a8ae440ce86a50341 /src | |
parent | e2b9ee292ecb8fd23843f815600817cba7438b2a (diff) | |
download | wix-3761d820d9407c0417e7ef26386d9d906e1e5329.tar.gz wix-3761d820d9407c0417e7ef26386d9d906e1e5329.tar.bz2 wix-3761d820d9407c0417e7ef26386d9d906e1e5329.zip |
Add enum for bundle variable Type.
Diffstat (limited to '')
-rw-r--r-- | src/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs | 17 | ||||
-rw-r--r-- | src/WixToolset.Data/Symbols/WixSetVariableSymbol.cs | 8 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs b/src/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs index 85cf2798..d68ac682 100644 --- a/src/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs +++ b/src/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs | |||
@@ -21,6 +21,8 @@ namespace WixToolset.Data | |||
21 | 21 | ||
22 | namespace WixToolset.Data.Symbols | 22 | namespace WixToolset.Data.Symbols |
23 | { | 23 | { |
24 | using System; | ||
25 | |||
24 | public enum WixBundleVariableSymbolFields | 26 | public enum WixBundleVariableSymbolFields |
25 | { | 27 | { |
26 | Value, | 28 | Value, |
@@ -29,6 +31,15 @@ namespace WixToolset.Data.Symbols | |||
29 | Persisted, | 31 | Persisted, |
30 | } | 32 | } |
31 | 33 | ||
34 | public enum WixBundleVariableType | ||
35 | { | ||
36 | Unknown, | ||
37 | Formatted, | ||
38 | Numeric, | ||
39 | String, | ||
40 | Version, | ||
41 | } | ||
42 | |||
32 | public class WixBundleVariableSymbol : IntermediateSymbol | 43 | public class WixBundleVariableSymbol : IntermediateSymbol |
33 | { | 44 | { |
34 | public WixBundleVariableSymbol() : base(SymbolDefinitions.WixBundleVariable, null, null) | 45 | public WixBundleVariableSymbol() : base(SymbolDefinitions.WixBundleVariable, null, null) |
@@ -47,10 +58,10 @@ namespace WixToolset.Data.Symbols | |||
47 | set => this.Set((int)WixBundleVariableSymbolFields.Value, value); | 58 | set => this.Set((int)WixBundleVariableSymbolFields.Value, value); |
48 | } | 59 | } |
49 | 60 | ||
50 | public string Type | 61 | public WixBundleVariableType Type |
51 | { | 62 | { |
52 | get => (string)this.Fields[(int)WixBundleVariableSymbolFields.Type]; | 63 | get => Enum.TryParse((string)this.Fields[(int)WixBundleVariableSymbolFields.Type], true, out WixBundleVariableType value) ? value : WixBundleVariableType.Unknown; |
53 | set => this.Set((int)WixBundleVariableSymbolFields.Type, value); | 64 | set => this.Set((int)WixBundleVariableSymbolFields.Type, value.ToString().ToLowerInvariant()); |
54 | } | 65 | } |
55 | 66 | ||
56 | public bool Hidden | 67 | public bool Hidden |
diff --git a/src/WixToolset.Data/Symbols/WixSetVariableSymbol.cs b/src/WixToolset.Data/Symbols/WixSetVariableSymbol.cs index 503c328b..05fdf561 100644 --- a/src/WixToolset.Data/Symbols/WixSetVariableSymbol.cs +++ b/src/WixToolset.Data/Symbols/WixSetVariableSymbol.cs | |||
@@ -19,6 +19,8 @@ namespace WixToolset.Data | |||
19 | 19 | ||
20 | namespace WixToolset.Data.Symbols | 20 | namespace WixToolset.Data.Symbols |
21 | { | 21 | { |
22 | using System; | ||
23 | |||
22 | public enum WixSetVariableSymbolFields | 24 | public enum WixSetVariableSymbolFields |
23 | { | 25 | { |
24 | Value, | 26 | Value, |
@@ -43,10 +45,10 @@ namespace WixToolset.Data.Symbols | |||
43 | set => this.Set((int)WixSetVariableSymbolFields.Value, value); | 45 | set => this.Set((int)WixSetVariableSymbolFields.Value, value); |
44 | } | 46 | } |
45 | 47 | ||
46 | public string Type | 48 | public WixBundleVariableType Type |
47 | { | 49 | { |
48 | get => (string)this.Fields[(int)WixSetVariableSymbolFields.Type]; | 50 | get => Enum.TryParse((string)this.Fields[(int)WixSetVariableSymbolFields.Type], true, out WixBundleVariableType value) ? value : WixBundleVariableType.Unknown; |
49 | set => this.Set((int)WixSetVariableSymbolFields.Type, value); | 51 | set => this.Set((int)WixSetVariableSymbolFields.Type, value.ToString().ToLowerInvariant()); |
50 | } | 52 | } |
51 | } | 53 | } |
52 | } | 54 | } |