recipe name filter
This commit is contained in:
@@ -276,6 +276,10 @@ namespace Inspectron.Settings
|
||||
{
|
||||
value = converter.ConvertFromInvariantString(valueString);
|
||||
}
|
||||
else if (TypeConverterRegistry.CanConvert(type))
|
||||
{
|
||||
value = TypeConverterRegistry.GetConverter(type).ConvertFrom(valueString);
|
||||
}
|
||||
else
|
||||
{
|
||||
// deserialize
|
||||
@@ -295,8 +299,8 @@ namespace Inspectron.Settings
|
||||
}
|
||||
private static bool CanConvertToAndFromString(TypeConverter converter)
|
||||
{
|
||||
return converter.CanConvertFrom(typeof(string)) &&
|
||||
converter.CanConvertTo(typeof(string));
|
||||
return (converter.CanConvertFrom(typeof(string)) &&
|
||||
converter.CanConvertTo(typeof(string)));
|
||||
}
|
||||
/// <summary>
|
||||
/// Class for group of user settings</summary>
|
||||
@@ -478,6 +482,10 @@ namespace Inspectron.Settings
|
||||
{
|
||||
valueString = converter.ConvertToInvariantString(value);
|
||||
}
|
||||
else if (TypeConverterRegistry.TryGetConverter(type, out var typeConverter))
|
||||
{
|
||||
valueString = typeConverter.ConvertTo(value, typeof(string)) as string;
|
||||
}
|
||||
else if (type.IsSerializable)
|
||||
{
|
||||
// serialize
|
||||
|
||||
Reference in New Issue
Block a user