mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-17 06:36:36 +08:00
sfc界面处理完成,还差顺序逻辑控制过程
This commit is contained in:
@@ -16,6 +16,7 @@ namespace Util.DiagramDesigner
|
||||
{
|
||||
//如果是字符串或值类型则直接返回
|
||||
if (obj == null || obj is string || obj.GetType().IsValueType) return obj;
|
||||
|
||||
object retval = Activator.CreateInstance(obj.GetType());
|
||||
FieldInfo[] fields = obj.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
|
||||
foreach (FieldInfo field in fields)
|
||||
@@ -45,6 +46,9 @@ namespace Util.DiagramDesigner
|
||||
|
||||
public static T AutoCopy<T>(T source) where T : new()
|
||||
{
|
||||
//如果是字符串或值类型则直接返回
|
||||
if (source == null || source is string || source.GetType().IsValueType) return source;
|
||||
|
||||
T target = new T();
|
||||
var Properties = typeof(T).GetProperties();
|
||||
foreach (var Propertie in Properties)
|
||||
@@ -61,7 +65,8 @@ namespace Util.DiagramDesigner
|
||||
|
||||
public static T DeepCopy<T>(T obj)
|
||||
{
|
||||
if (obj == null) return obj;
|
||||
//如果是字符串或值类型则直接返回
|
||||
if (obj == null || obj is string || obj.GetType().IsValueType) return obj;
|
||||
|
||||
object retval;
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
|
||||
Reference in New Issue
Block a user