忘记改啥了*1

This commit is contained in:
fengjiayi
2024-11-02 16:48:40 +08:00
parent 0088d32f12
commit cd1642dcf7
45 changed files with 1022 additions and 447 deletions

View File

@@ -1,5 +1,6 @@
using Newtonsoft.Json;
using Serein.Library;
using System.IO;
using System.Windows;
using System.Windows.Threading;
@@ -12,14 +13,19 @@ namespace Serein.Workbench
{
void LoadLocalProject()
{
#if DEBUG
if (1 == 1)
if (1 == 11)
{
string filePath;
filePath = @"F:\临时\project\linux\project.dnf";
filePath = @"F:\临时\project\linux\http\project.dnf";
filePath = @"F:\临时\project\yolo flow\project.dnf";
string content = System.IO.File.ReadAllText(filePath); // 读取整个文件内容
App.FlowProjectData = JsonConvert.DeserializeObject<SereinProjectData>(content);
App.FileDataPath = System.IO.Path.GetDirectoryName(filePath)!; // filePath;//
var dir = Path.GetDirectoryName(filePath);
//System.IO.Directory.SetCurrentDirectory(dir);
}
#endif
}

View File

@@ -12,6 +12,8 @@ using Serein.Workbench.Node.ViewModel;
using Serein.Workbench.Themes;
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
@@ -247,11 +249,12 @@ namespace Serein.Workbench
return;
}
InitializeCanvas(project.Basic.Canvas.Width, project.Basic.Canvas.Height);// 设置画布大小
foreach (var connection in Connections)
{
connection.RefreshLine(); // 窗体完成加载后试图刷新所有连接线
}
//foreach (var connection in Connections)
//{
// connection.RefreshLine(); // 窗体完成加载后试图刷新所有连接线
//}
Console.WriteLine($"运行环境当前工作目录:{System.IO.Directory.GetCurrentDirectory()}");
var canvasData = project.Basic.Canvas;
if (canvasData is not null)
{
@@ -267,7 +270,12 @@ namespace Serein.Workbench
FlowChartCanvas.RenderTransform = canvasTransformGroup;
}
}
#endregion
#region

View File

@@ -21,7 +21,7 @@ namespace Serein.Workbench.Node.ViewModel
/// <summary>
/// 自定义参数值
/// </summary>
public object? CustomData
public string? CustomData
{
get => NodeModel.CustomData;
set { NodeModel.CustomData = value ; OnPropertyChanged(); }
@@ -42,9 +42,12 @@ namespace Serein.Workbench.Node.ViewModel
public ConditionNodeControlViewModel(SingleConditionNode node) : base(node)
{
this.NodeModel = node;
IsCustomData = false;
CustomData = "";
Expression = "PASS";
if(node is null)
{
IsCustomData = false;
CustomData = "";
Expression = "PASS";
}
}
}

View File

@@ -21,13 +21,15 @@
<ColumnDefinition Width="auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!--连接控制器-->
<view:ArgJunctionControl x:Name="ArgJunctionControl" Grid.Column="0" ArgIndex="{Binding Index}" MyNode="{Binding NodeModel}" />
<ContentControl Content="{Binding}" Grid.Column="1">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Style.Triggers>
<!--无须指定参数-->
<MultiDataTrigger>
<!--无须指定参数-->
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsExplicitData}" Value="false" />
</MultiDataTrigger.Conditions>
@@ -84,6 +86,7 @@
</Setter.Value>
</Setter>
</MultiDataTrigger>
<!--指定参数:文本类型(可输入)-->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>