系统优化

This commit is contained in:
akwkevin
2025-02-03 15:22:00 +08:00
parent ddf89e21e4
commit 141ba3b775
14 changed files with 871 additions and 66 deletions

View File

@@ -90,15 +90,18 @@ namespace AIStudio.Wpf.DiagramDesigner
D d = Activator.CreateInstance<D>(); //构造新实例
try
{
var Types = s.GetType();//获得类型
var Typed = typeof(D);
foreach (PropertyInfo sp in Types.GetProperties().Where(p => p.CanRead))//获得类型的属性字段
if (s != null)
{
foreach (PropertyInfo dp in Typed.GetProperties().Where(p => p.CanWrite))
var Types = s.GetType();//获得类型
var Typed = typeof(D);
foreach (PropertyInfo sp in Types.GetProperties().Where(p => p.CanRead))//获得类型的属性字段
{
if (dp.Name == sp.Name && dp.PropertyType == sp.PropertyType)//判断属性名是否相同
foreach (PropertyInfo dp in Typed.GetProperties().Where(p => p.CanWrite))
{
dp.SetValue(d, sp.GetValue(s, null), null);//获得s对象属性的值复制给d对象的属性
if (dp.Name == sp.Name && dp.PropertyType == sp.PropertyType)//判断属性名是否相同
{
dp.SetValue(d, sp.GetValue(s, null), null);//获得s对象属性的值复制给d对象的属性
}
}
}
}