@joebigelow / wix-1 / commits / 4eb2b075

Support long as a number

Rob Mensching committed May 8, 2019 at 23:50 UTC 4eb2b075b0b2a94fc3faa76271c21ac413bf4c96
1 file changed +13 -1
src/WixToolset.Data/IntermediateFieldValueExtensions.cs
+13 -1
@@ -1,4 +1,4 @@
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.
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.Data
4 {
@@ -26,6 +26,10 @@ namespace WixToolset.Data
26 {
27 return n != 0;
28 }
29 + else if (value.Data is long l)
30 + {
31 + return l != 0;
32 + }
33 else if (value.Data is string s)
34 {
35 if (s.Equals("yes", StringComparison.OrdinalIgnoreCase) || s.Equals("true", StringComparison.OrdinalIgnoreCase))
@@ -57,6 +61,10 @@ namespace WixToolset.Data
61 {
62 return n;
63 }
64 + else if (value.Data is long l)
65 + {
66 + return (int)l;
67 + }
68 else if (value.Data is bool b)
69 {
70 return b ? 1 : 0;
@@ -88,6 +96,10 @@ namespace WixToolset.Data
96 {
97 return n.ToString();
98 }
99 + else if (value.Data is long l)
100 + {
101 + return l.ToString();
102 + }
103 else if (value.Data is bool b)
104 {
105 return b ? "true" : "false";