附加信息准备中

This commit is contained in:
kwai
2023-03-13 19:44:30 +08:00
parent 414eb28867
commit 31872222bc
12 changed files with 146 additions and 73 deletions

View File

@@ -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
{