Added TypeDescriptor.GetConverter().ConvertFromInvariantString(..) to Cast.To(..)
ln.build - build0.waldrennach.l--n.de build job pending
Details
ln.build - build0.waldrennach.l--n.de build job pending
Details
parent
1b3255dbb0
commit
38bc2953d6
5
Cast.cs
5
Cast.cs
|
@ -12,6 +12,7 @@ using System.Reflection;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Net.Http.Headers;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace ln.type
|
||||
{
|
||||
|
@ -68,6 +69,10 @@ namespace ln.type
|
|||
|
||||
targetValue = castedArray;
|
||||
}
|
||||
else if ((value is string text) && (TypeDescriptor.GetConverter(targetType).CanConvertFrom(typeof(string))))
|
||||
{
|
||||
targetValue = TypeDescriptor.GetConverter(targetType).ConvertFromInvariantString(value as string);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetValue = Convert.ChangeType(value, targetType);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<Version>0.1.3</Version>
|
||||
<Version>0.1.4</Version>
|
||||
<Authors>Harald Wolff-Thobaben</Authors>
|
||||
<Company>l--n.de</Company>
|
||||
<AssemblyVersion>0.0.1.0</AssemblyVersion>
|
||||
|
|
Loading…
Reference in New Issue