mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-03-03 00:00:57 +08:00
Connector 错误处理
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using AIStudio.Wpf.DiagramDesigner.Enums;
|
||||
using AIStudio.Wpf.DiagramDesigner.Models;
|
||||
|
||||
namespace AIStudio.Wpf.DiagramDesigner
|
||||
@@ -276,6 +277,7 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
var connector = GetSourceItem(input.Value);
|
||||
if (connector == null)
|
||||
{
|
||||
input.Value.ErrorCode = ConnectorErrorCode.None;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -301,9 +303,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
}
|
||||
else
|
||||
{
|
||||
input.Value.ConnectorError = true;
|
||||
input.Value.ErrorCode = ConnectorErrorCode.ConnErr;
|
||||
input.Value.ErrorMessage = "连接类型不匹配";
|
||||
input.Value.ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
input.Value.ColorViewModel.FillColor.Color = Colors.DarkRed;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,9 +315,9 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
foreach (var output in Output)
|
||||
{
|
||||
if (output.Value.ValueError)
|
||||
if (output.Value.ErrorCode != ConnectorErrorCode.None)
|
||||
{
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.Orange;
|
||||
output.Value.ColorViewModel.FillColor.Color = Colors.DarkRed;
|
||||
}
|
||||
else if (output.Value.ConnectorValueType == ConnectorValueType.Bool)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user