mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-22 09:26:35 +08:00
附加信息准备中
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Helpers;
|
||||
using Newtonsoft.Json;
|
||||
@@ -37,9 +38,10 @@ namespace AIStudio.Wpf.DiagramModels
|
||||
protected override DiagramLink Create(Type objectType, JObject jObject)
|
||||
{
|
||||
//第一种方法:判断属性值来确认是哪个派生类
|
||||
if (FieldExists("Type", jObject, out string type))
|
||||
if (FieldExists("Type", jObject, out string typename))
|
||||
{
|
||||
return new DiagramLink();
|
||||
var type = TypeHelper.GetType(typename);
|
||||
return type != null ? (System.Activator.CreateInstance(type) as DiagramLink) : new DiagramLink();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user