This commit is contained in:
CortexCore
2024-08-08 23:07:50 +08:00
parent dffda3663b
commit 5038fe33d1
9 changed files with 66 additions and 22 deletions

View File

@@ -8,12 +8,20 @@
{
if (info.CanWrite is false) continue;
var targetInfo = target.GetType().GetProperty(info.Name, ReflectionHelper.Flags);
targetInfo?.SetValue(target, info.GetValue(source));
var value = info.GetValue(source);
if (value is not null)
{
targetInfo?.SetValue(target,value );
}
}
foreach (var info in source.GetType().GetFields(ReflectionHelper.Flags))
{
var targetInfo = target.GetType().GetField(info.Name, ReflectionHelper.Flags);
targetInfo?.SetValue(target, info.GetValue(source));
var value = info.GetValue(source);
if (value is not null)
{
targetInfo?.SetValue(target, value);
}
}
}
}