|
3 | 3 | using System.Collections.Generic; |
4 | 4 | using System.Collections.Specialized; |
5 | 5 | using System.ComponentModel; |
| 6 | +using System.Globalization; |
6 | 7 | using System.Linq; |
7 | 8 | using System.Runtime.CompilerServices; |
8 | 9 | using System.Text; |
@@ -124,24 +125,24 @@ public static void SetEventProperty<TEventArgs>(this IParameterViewComponent com |
124 | 125 |
|
125 | 126 | public static string ConvertToString<TValue>(this IParameterViewComponent component, TValue value) |
126 | 127 | { |
127 | | - return TypeDescriptor.GetConverter(typeof(TValue)).ConvertToString(value); |
| 128 | + return TypeDescriptor.GetConverter(typeof(TValue)).ConvertToString(null, CultureInfo.InvariantCulture, value); |
128 | 129 | } |
129 | 130 |
|
130 | 131 | public static TValue ConvertFromString<TValue>(this IParameterViewComponent component, string value) |
131 | 132 | { |
132 | | - return (TValue)TypeDescriptor.GetConverter(typeof(TValue)).ConvertFromString(value); |
| 133 | + return (TValue)TypeDescriptor.GetConverter(typeof(TValue)).ConvertFromString(null, CultureInfo.InvariantCulture, value); |
133 | 134 | } |
134 | 135 |
|
135 | 136 | public static string ConvertToString<TConverter, TValue>(this IParameterViewComponent component, TValue value) |
136 | 137 | where TConverter : TypeConverter, new() |
137 | 138 | { |
138 | | - return new TConverter().ConvertToString(value); |
| 139 | + return new TConverter().ConvertToString(null, CultureInfo.InvariantCulture, value); |
139 | 140 | } |
140 | 141 |
|
141 | 142 | public static TValue ConvertFromString<TConverter, TValue>(this IParameterViewComponent component, string value) |
142 | 143 | where TConverter : TypeConverter, new() |
143 | 144 | { |
144 | | - return (TValue)new TConverter().ConvertFromString(value); |
| 145 | + return (TValue)new TConverter().ConvertFromString(null, CultureInfo.InvariantCulture, value); |
145 | 146 | } |
146 | 147 |
|
147 | 148 | public static ITemplate GetTemplateProperty(this IParameterViewComponent component, RenderFragment value) |
|
0 commit comments