Helper also know type string; move to .net 10
This commit is contained in:
parent
cc579102cb
commit
7f3f3a7b89
@ -23,7 +23,9 @@ namespace BlubbFish.Utils {
|
||||
public static void SetProperty(this Object o, String name, String value) {
|
||||
PropertyInfo prop = o.GetType().GetProperty(name);
|
||||
if (prop.CanWrite) {
|
||||
if (prop.PropertyType == typeof(Boolean) && Boolean.TryParse(value, out Boolean vb)) {
|
||||
if(prop.PropertyType == typeof(String)) {
|
||||
prop.SetValue(o, value);
|
||||
} else if (prop.PropertyType == typeof(Boolean) && Boolean.TryParse(value, out Boolean vb)) {
|
||||
prop.SetValue(o, vb);
|
||||
} else if (prop.PropertyType == typeof(Byte) && Byte.TryParse(value, out Byte v8)) {
|
||||
prop.SetValue(o, v8);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<AssemblyName>Utils</AssemblyName>
|
||||
<RootNamespace>BlubbFish.Utils</RootNamespace>
|
||||
<Description>Provides useful classes for other projects</Description>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user