web socket添加token验证能力(使用token+创建时设置验证回调);flowEnv添加WebSocket处理消息能力,下一步将开发远程登录登录工具。

This commit is contained in:
fengjiayi
2024-10-15 21:56:09 +08:00
parent dbbde4f03e
commit 1d97ea5da1
64 changed files with 811 additions and 395 deletions

View File

@@ -1,7 +1,7 @@
<Application x:Class="Serein.WorkBench.App"
<Application x:Class="Serein.Workbench.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Serein.WorkBench"
xmlns:local="clr-namespace:Serein.Workbench"
StartupUri="MainWindow.xaml"
Startup="Application_Startup">
<Application.Resources>

View File

@@ -5,7 +5,7 @@ using Serein.NodeFlow.Tool;
using System.Diagnostics;
using System.Windows;
namespace Serein.WorkBench
namespace Serein.Workbench
{
/// <summary>
/// Interaction logic for App.xaml

View File

@@ -1,9 +1,9 @@
<Window x:Class="Serein.WorkBench.LogWindow"
<Window x:Class="Serein.Workbench.LogWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Serein.WorkBench"
xmlns:local="clr-namespace:Serein.Workbench"
mc:Ignorable="d"
Topmost="True"
Title="LogWindow" Height="600" Width="400"

View File

@@ -1,6 +1,6 @@
using System.Windows;
namespace Serein.WorkBench
namespace Serein.Workbench
{
/// <summary>
/// DebugWindow.xaml 的交互逻辑
@@ -23,7 +23,7 @@ namespace Serein.WorkBench
private const int MaxLines = 1000; // 最大显示的行数
private bool autoScroll = true; // 自动滚动标识
private int flushThreshold = 1000; // 设置日志刷新阈值
private const int maxFlushSize = 10000; // 每次最大刷新字符数
private const int maxFlushSize = 1000; // 每次最大刷新字符数
public LogWindow()
{

View File

@@ -1,10 +1,10 @@
<Window x:Class="Serein.WorkBench.MainWindow"
<Window x:Class="Serein.Workbench.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Serein.WorkBench"
xmlns:tool="clr-namespace:Serein.WorkBench.Tool.Converters"
xmlns:nodeView="clr-namespace:Serein.WorkBench.Node.View"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench"
xmlns:tool="clr-namespace:Serein.Workbench.Tool.Converters"
xmlns:nodeView="clr-namespace:Serein.Workbench.Node.View"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
Title="Dynamic Node Flow" Height="900" Width="1400"
AllowDrop="True" Drop="Window_Drop" DragOver="Window_DragOver"
Loaded="Window_Loaded"
@@ -36,11 +36,10 @@
</Grid.ColumnDefinitions>
<Menu DockPanel.Dock="Top" Grid.Row="0" Height="20">
<MenuItem Header="文件">
<MenuItem Header="项目">
<!--菜单项为MenuItem文字使用属性 Header-->
<MenuItem Header="保存项目" Click="ButtonSaveFile_Click" ></MenuItem>
<MenuItem Header="打开本地文件" Click="OpenLocalProject_Click"></MenuItem>
<MenuItem Header="连接远程环境" Click="OpenRemoteProject_Click"></MenuItem>
<MenuItem Header="打开本地文件" Click="ButtonOpenLocalProject_Click"></MenuItem>
</MenuItem>
<MenuItem Header="调试">
<MenuItem Header="运行(从起始节点)" Click="ButtonDebugRun_Click"></MenuItem>
@@ -51,6 +50,11 @@
<MenuItem Header="输出窗口" Click="ButtonOpenConsoleOutWindow_Click"></MenuItem>
<MenuItem Header="重置画布" Click="ButtonResetCanvas_Click"></MenuItem>
</MenuItem>
<MenuItem Header="远程">
<MenuItem Header="启动远程服务" Click="ButtonStartRemoteServer_Click"></MenuItem>
<MenuItem Header="连接远程环境" Click="ButtonConnectionRemoteEnv_Click"></MenuItem>
</MenuItem>
<!--<MenuItem Header="说明"></MenuItem>-->
</Menu>
@@ -107,8 +111,8 @@
MouseLeftButtonDown ="FlowChartCanvas_MouseLeftButtonDown"
MouseLeftButtonUp="FlowChartCanvas_MouseLeftButtonUp"
MouseDown="FlowChartCanvas_MouseDown"
MouseMove="FlowChartCanvas_MouseMove"
MouseUp="FlowChartCanvas_MouseUp"
MouseMove="FlowChartCanvas_MouseMove"
MouseWheel="FlowChartCanvas_MouseWheel"
Drop="FlowChartCanvas_Drop"
DragOver="FlowChartCanvas_DragOver">

View File

@@ -9,11 +9,12 @@ using Serein.NodeFlow.Base;
using Serein.NodeFlow.Model;
using Serein.NodeFlow.Tool;
using Serein.NodeFlow.Tool.SereinExpression;
using Serein.WorkBench.Node;
using Serein.WorkBench.Node.View;
using Serein.WorkBench.Node.ViewModel;
using Serein.WorkBench.Themes;
using Serein.WorkBench.tool;
using Serein.Workbench.Node;
using Serein.Workbench.Node.View;
using Serein.Workbench.Node.ViewModel;
using Serein.Workbench.Themes;
using Serein.Workbench.tool;
using System;
using System.IO;
using System.Reflection;
using System.Text.Json;
@@ -31,18 +32,21 @@ using System.Windows.Threading;
using System.Xml.Linq;
using DataObject = System.Windows.DataObject;
namespace Serein.WorkBench
namespace Serein.Workbench
{
/// <summary>
/// 拖拽创建节点类型
/// </summary>
public static class MouseNodeType
{
/// <summary>
/// 创建来自DLL的节点
/// </summary>
public static string CreateDllNodeInCanvas { get; } = nameof(CreateDllNodeInCanvas);
/// <summary>
/// 创建基础节点
/// </summary>
public static string CreateBaseNodeInCanvas { get; } = nameof(CreateBaseNodeInCanvas);
//public static string RegionType { get; } = nameof(RegionType);
//public static string BaseNodeType { get; } = nameof(BaseNodeType);
//public static string DllNodeType { get; } = nameof(DllNodeType);
}
@@ -153,6 +157,7 @@ namespace Serein.WorkBench
public MainWindow()
{
InitializeComponent();
logWindow = InitConsoleOut(); // 重定向 Console 输出
ViewModel = new MainWindowViewModel(this);
FlowEnvironment = ViewModel.FlowEnvironment;
@@ -160,7 +165,6 @@ namespace Serein.WorkBench
IOCObjectViewer.FlowEnvironment = FlowEnvironment;
InitFlowEnvironmentEvent(); // 配置环境事件
logWindow = InitConsoleOut(); // 重定向 Console 输出
canvasTransformGroup = new TransformGroup();
scaleTransform = new ScaleTransform();
@@ -199,10 +203,12 @@ namespace Serein.WorkBench
FlowEnvironment.OnIOCMembersChanged += FlowEnvironment_OnIOCMembersChanged;
FlowEnvironment.OnNodeLocate += FlowEnvironment_OnNodeLocate;
FlowEnvironment.OnNodeLocated += FlowEnvironment_OnNodeLocate;
FlowEnvironment.OnNodeMoved += FlowEnvironment_OnNodeMoved;
}
private LogWindow InitConsoleOut()
{
@@ -710,6 +716,26 @@ namespace Serein.WorkBench
nodeControl.RenderTransform = null; // 或者重新设置为默认值
};
}
private void FlowEnvironment_OnNodeMoved(NodeMovedEventArgs eventArgs)
{
if (!TryGetControl(eventArgs.NodeGuid, out var nodeControl)) return;
var newLeft = eventArgs.X;
var newTop = eventArgs.Y;
// 限制控件不超出FlowChartCanvas的边界
if (newLeft >= 0 && newLeft + nodeControl.ActualWidth <= FlowChartCanvas.ActualWidth)
{
Canvas.SetLeft(nodeControl, newLeft);
}
if (newTop >= 0 && newTop + nodeControl.ActualHeight <= FlowChartCanvas.ActualHeight)
{
Canvas.SetTop(nodeControl, newTop);
}
//Canvas.SetLeft(nodeControl,);
//Canvas.SetTop(nodeControl, );
}
/// <summary>
/// Guid 转 NodeControl
@@ -819,7 +845,7 @@ namespace Serein.WorkBench
}
/// <summary>
/// 配置节点事件
/// 配置节点事件(移动,点击相关)
/// </summary>
/// <param name="nodeControl"></param>
private void ConfigureNodeEvents(NodeControlBase nodeControl)
@@ -1295,87 +1321,65 @@ namespace Serein.WorkBench
if (IsControlDragging) // 如果正在拖动控件
{
Point currentPosition = e.GetPosition(FlowChartCanvas); // 获取当前鼠标位置
// 批量移动 与 单个节点控件移动
if (selectNodeControls.Count > 0 && sender is NodeControlBase element && selectNodeControls.Contains(element))
if (selectNodeControls.Count > 0 && sender is NodeControlBase nodeControlMain && selectNodeControls.Contains(nodeControlMain))
{
// 获取element控件的旧位置
double oldLeft = Canvas.GetLeft(element);
double oldTop = Canvas.GetTop(element);
// 进行批量移动
// 获取旧位置
var oldLeft = Canvas.GetLeft(nodeControlMain);
var oldTop = Canvas.GetTop(nodeControlMain);
// 计算被选择控件的偏移量
double deltaX = (int)(currentPosition.X - startControlDragPoint.X);
double deltaY = (int)(currentPosition.Y - startControlDragPoint.Y);
var deltaX = /*(int)*/(currentPosition.X - startControlDragPoint.X);
var deltaY = /*(int)*/(currentPosition.Y - startControlDragPoint.Y);
// 移动被选择的控件
double newLeft = oldLeft + deltaX;
double newTop = oldTop + deltaY;
var newLeft = oldLeft + deltaX;
var newTop = oldTop + deltaY;
// 限制控件不超出FlowChartCanvas的边界
if (newLeft >= 0 && newLeft + element.ActualWidth <= FlowChartCanvas.ActualWidth)
{
Canvas.SetLeft(element, newLeft);
}
if (newTop >= 0 && newTop + element.ActualHeight <= FlowChartCanvas.ActualHeight)
{
Canvas.SetTop(element, newTop);
}
this.FlowEnvironment.MoveNode(nodeControlMain.ViewModel.Node.Guid, newLeft, newTop); // 移动节点
// 计算控件实际移动的距离
var actualDeltaX = newLeft - oldLeft;
var actualDeltaY = newTop - oldTop;
// 计算element实际移动的距离
double actualDeltaX = newLeft - oldLeft;
double actualDeltaY = newTop - oldTop;
// 移动其它选中的控件
foreach (var nodeControl in selectNodeControls)
{
if (nodeControl != element) // 跳过已经移动的控件
if (nodeControl != nodeControlMain) // 跳过已经移动的控件
{
double otherNewLeft = Canvas.GetLeft(nodeControl) + actualDeltaX;
double otherNewTop = Canvas.GetTop(nodeControl) + actualDeltaY;
// 限制控件不超出FlowChartCanvas的边界
if (otherNewLeft >= 0 && otherNewLeft + nodeControl.ActualWidth <= FlowChartCanvas.ActualWidth)
{
Canvas.SetLeft(nodeControl, otherNewLeft);
}
if (otherNewTop >= 0 && otherNewTop + nodeControl.ActualHeight <= FlowChartCanvas.ActualHeight)
{
Canvas.SetTop(nodeControl, otherNewTop);
}
var otherNewLeft = Canvas.GetLeft(nodeControl) + actualDeltaX;
var otherNewTop = Canvas.GetTop(nodeControl) + actualDeltaY;
this.FlowEnvironment.MoveNode(nodeControl.ViewModel.Node.Guid, otherNewLeft, otherNewTop); // 移动节点
}
}
// 更新节点之间线的连接位置
foreach (var nodeControl in selectNodeControls)
{
UpdateConnections(nodeControl);
}
startControlDragPoint = currentPosition; // 更新起始点位置
}
else
{ // 获取引发事件的控件
if (sender is not UserControl block)
{ // 单个节点移动
if (sender is not NodeControlBase nodeControl)
{
return;
}
double deltaX = currentPosition.X - startControlDragPoint.X; // 计算X轴方向的偏移量
double deltaY = currentPosition.Y - startControlDragPoint.Y; // 计算Y轴方向的偏移量
double newLeft = Canvas.GetLeft(block) + deltaX; // 新的边距
double newTop = Canvas.GetTop(block) + deltaY; // 新的上边距
//Console.WriteLine((Canvas.GetLeft(block), Canvas.GetTop(block)));
// 限制控件不超出FlowChartCanvas的边界
if (newLeft >= 0 && newLeft + block.ActualWidth <= FlowChartCanvas.ActualWidth)
{
Canvas.SetLeft(block, newLeft);
}
if (newTop >= 0 && newTop + block.ActualHeight <= FlowChartCanvas.ActualHeight)
{
Canvas.SetTop(block, newTop);
}
UpdateConnections(block);
double newLeft = Canvas.GetLeft(nodeControl) + deltaX; // 新的左边距
double newTop = Canvas.GetTop(nodeControl) + deltaY; // 新的边距
this.FlowEnvironment.MoveNode(nodeControl.ViewModel.Node.Guid, newLeft, newTop); // 移动节点
UpdateConnections(nodeControl);
}
startControlDragPoint = currentPosition; // 更新起始点位置
}
}
private void ChangeViewerObjOfNode(NodeControlBase nodeControl)
{
var node = nodeControl.ViewModel.Node;
@@ -1755,7 +1759,6 @@ namespace Serein.WorkBench
/// <param name="e"></param>
private void FlowChartCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Console.WriteLine(1);
if (!IsSelectControl)
{
// 进入选取状态
@@ -2352,7 +2355,7 @@ namespace Serein.WorkBench
/// <param name="e"></param>
private void ButtonDebugFlipflopNode_Click(object sender, RoutedEventArgs e)
{
FlowEnvironment?.Exit(); // 在运行平台上点击了退出
FlowEnvironment?.ExitFlow(); // 在运行平台上点击了退出
}
/// <summary>
@@ -2372,7 +2375,7 @@ namespace Serein.WorkBench
}
else
{
await this.FlowEnvironment.StartFlowInSelectNodeAsync(selectNodeControls[0].ViewModel.Node.Guid);
await this.FlowEnvironment.StartAsyncInSelectNode(selectNodeControls[0].ViewModel.Node.Guid);
}
}
@@ -2489,25 +2492,12 @@ namespace Serein.WorkBench
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OpenLocalProject_Click(object sender, RoutedEventArgs e)
private void ButtonOpenLocalProject_Click(object sender, RoutedEventArgs e)
{
}
/// <summary>
/// 连接远程运行环境
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void OpenRemoteProject_Click(object sender, RoutedEventArgs e)
{
var windowEnvRemoteLoginView = new WindowEnvRemoteLoginView((addres,port,token) =>
{
this.FlowEnvironment.LoadRemoteProject(addres, port, token);
});
windowEnvRemoteLoginView.Show();
}
#endregion
@@ -2531,6 +2521,26 @@ namespace Serein.WorkBench
#endregion
#region -
private async void ButtonStartRemoteServer_Click(object sender, RoutedEventArgs e)
{
await this.FlowEnvironment.StartRemoteServerAsync();
}
/// <summary>
/// 连接远程运行环境
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ButtonConnectionRemoteEnv_Click(object sender, RoutedEventArgs e)
{
var windowEnvRemoteLoginView = new WindowEnvRemoteLoginView((addres, port, token) =>
{
this.FlowEnvironment.LoadRemoteProject(addres, port, token);
});
windowEnvRemoteLoginView.Show();
}
#endregion
@@ -2636,6 +2646,7 @@ namespace Serein.WorkBench
MessageBox.Show("所有DLL已卸载。", "信息", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
#region UI层面上显示为 线

View File

@@ -4,7 +4,7 @@ using Serein.Library.Entity;
using Serein.Library.Utils;
using Serein.NodeFlow;
using Serein.NodeFlow.Tool;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -14,12 +14,24 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Serein.WorkBench
namespace Serein.Workbench
{
/// <summary>
/// 工作台数据视图
/// </summary>
/// <param name="window"></param>
public class MainWindowViewModel
{
private readonly MainWindow window ;
/// <summary>
/// 运行环境
/// </summary>
public IFlowEnvironment FlowEnvironment { get; set; }
/// <summary>
/// 工作台数据视图
/// </summary>
/// <param name="window"></param>
public MainWindowViewModel(MainWindow window)
{
FlowEnvironment = new FlowEnvironment();

View File

@@ -8,7 +8,7 @@ using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public abstract class NodeControlViewModelBase : INotifyPropertyChanged
{

View File

@@ -1,12 +1,12 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ActionNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ActionNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:Converters="clr-namespace:Serein.WorkBench.Tool.Converters"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:Converters="clr-namespace:Serein.Workbench.Tool.Converters"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>
<!--<BooleanToVisibilityConverter x:Key="BoolToVisConverter" />-->

View File

@@ -1,9 +1,9 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Runtime.CompilerServices;
using System.Windows.Controls;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ActionNode.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ActionRegionControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ActionRegionControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<!--<Border BorderBrush="Black" BorderThickness="1" Padding="10">

View File

@@ -1,11 +1,12 @@
using Serein.NodeFlow;
using Serein.NodeFlow.Model;
using Serein.Workbench.Node.View;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ActionRegion.xaml 的交互逻辑

View File

@@ -1,11 +1,11 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ConditionNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ConditionNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ConditionNode.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ConditionRegionControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ConditionRegionControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<Border BorderBrush="Black" BorderThickness="1" Padding="10">

View File

@@ -1,11 +1,11 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ConditionRegion.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Node.View.DllControl"
<UserControl x:Class="Serein.Workbench.Node.View.DllControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300"
>
<DockPanel>
@@ -21,7 +21,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<GroupBox x:Name="ActionNodes" Grid.Row="0" Header="动作" Margin="5">
<GroupBox x:Name="Ac" Grid.Row="0" Header="动作" Margin="5">
<ListBox x:Name="ActionsListBox" Background="#D0F1F9"/>
</GroupBox>
<GroupBox x:Name="FlipflopNodes" Grid.Row="1" Header="触发器" Margin="5" >

View File

@@ -8,7 +8,7 @@ using System.Windows.Automation;
using System.Windows.Controls;
using System.Windows.Input;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{

View File

@@ -1,9 +1,9 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.ExpOpNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.ExpOpNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
MaxWidth="300">
<Grid>
<Grid.RowDefinitions>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// ExprOpNodeControl.xaml 的交互逻辑

View File

@@ -1,13 +1,13 @@
<local:NodeControlBase x:Class="Serein.WorkBench.Node.View.FlipflopNodeControl"
<local:NodeControlBase x:Class="Serein.Workbench.Node.View.FlipflopNodeControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:Converters="clr-namespace:Serein.WorkBench.Tool.Converters"
xmlns:local="clr-namespace:Serein.WorkBench.Node.View"
xmlns:vm="clr-namespace:Serein.WorkBench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.WorkBench.Themes"
xmlns:Converters="clr-namespace:Serein.Workbench.Tool.Converters"
xmlns:local="clr-namespace:Serein.Workbench.Node.View"
xmlns:vm="clr-namespace:Serein.Workbench.Node.ViewModel"
xmlns:themes="clr-namespace:Serein.Workbench.Themes"
MaxWidth="300">
<UserControl.Resources>

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
/// StateNode.xaml 的交互逻辑

View File

@@ -1,7 +1,7 @@
using Serein.Library.Api;
using Serein.Library.Entity;
using Serein.NodeFlow.Base;
using Serein.WorkBench.Node.ViewModel;
using Serein.Workbench.Node.ViewModel;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
@@ -9,7 +9,7 @@ using System.Runtime.CompilerServices;
using System.Windows.Controls;
using System.Windows.Media;
namespace Serein.WorkBench.Node.View
namespace Serein.Workbench.Node.View
{
/// <summary>
@@ -34,24 +34,19 @@ namespace Serein.WorkBench.Node.View
//public class FLowNodeObObservableCollection<T> : ObservableCollection<T>
//{
public class FLowNodeObObservableCollection<T> : ObservableCollection<T>
{
public void AddRange(IEnumerable<T> items)
{
foreach (var item in items)
{
this.Items.Add(item);
}
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add));
}
}
// public void AddRange(IEnumerable<T> items)
// {
// foreach (var item in items)
// {
// this.Items.Add(item);
// }
// OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add));
// }
//}
}

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ActionNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -1,8 +1,11 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
/// <summary>
/// 条件节点
/// </summary>
public class ConditionNodeControlViewModel : NodeControlViewModelBase
{
private readonly SingleConditionNode singleConditionNode;
@@ -32,6 +35,10 @@ namespace Serein.WorkBench.Node.ViewModel
set { singleConditionNode.Expression = value; OnPropertyChanged(); }
}
/// <summary>
/// 条件节点
/// </summary>
/// <param name="node"></param>
public ConditionNodeControlViewModel(SingleConditionNode node) : base(node)
{
this.singleConditionNode = node;

View File

@@ -1,12 +1,12 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ConditionRegionNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class ExpOpNodeViewModel: NodeControlViewModelBase
{

View File

@@ -1,7 +1,7 @@
using Serein.NodeFlow.Model;
using Serein.WorkBench.Node.View;
using Serein.Workbench.Node.View;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class FlipflopNodeControlViewModel : NodeControlViewModelBase
{

View File

@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Serein.WorkBench.Node.ViewModel
namespace Serein.Workbench.Node.ViewModel
{
public class TypeToStringConverter : IValueConverter
{

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Themes.IOCObjectViewControl"
<UserControl x:Class="Serein.Workbench.Themes.IOCObjectViewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>

View File

@@ -17,7 +17,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml.Linq;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// IOCObjectViewControl.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<Window x:Class="Serein.WorkBench.Themes.InputDialog"
<Window x:Class="Serein.Workbench.Themes.InputDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
Title="InputDialog" Height="450" Width="800">
<StackPanel Margin="10">

View File

@@ -12,7 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// InputDialog.xaml 的交互逻辑

View File

@@ -1,7 +1,7 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
xmlns:sys="clr-namespace:System;assembly=mscorlib">

View File

@@ -6,7 +6,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
public class MultiConditionConverter : IMultiValueConverter
{

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Themes.NodeTreeItemViewControl"
<UserControl x:Class="Serein.Workbench.Themes.NodeTreeItemViewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="200">
<UserControl.Resources>

View File

@@ -19,9 +19,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml.Linq;
using static Serein.WorkBench.Themes.TypeViewerWindow;
using static Serein.Workbench.Themes.TypeViewerWindow;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// NodeTreeVIewControl.xaml 的交互逻辑
@@ -156,7 +156,7 @@ namespace Serein.WorkBench.Themes
var contextMenu = new ContextMenu();
contextMenu.Items.Add(MainWindow.CreateMenuItem("从此节点执行", (s, e) =>
{
flowEnvironment.StartFlowInSelectNodeAsync(tmpNodeTreeModel.RootNode.Guid);
flowEnvironment.StartAsyncInSelectNode(tmpNodeTreeModel.RootNode.Guid);
}));
contextMenu.Items.Add(MainWindow.CreateMenuItem("定位", (s, e) => flowEnvironment.NodeLocated(tmpNodeTreeModel.RootNode.Guid)));

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Themes.NodeTreeViewControl"
<UserControl x:Class="Serein.Workbench.Themes.NodeTreeViewControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>

View File

@@ -15,7 +15,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// NodeTreeViewControl.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<UserControl x:Class="Serein.WorkBench.Themes.ObjectViewerControl"
<UserControl x:Class="Serein.Workbench.Themes.ObjectViewerControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
d:DesignHeight="400" d:DesignWidth="400">
<Grid>

View File

@@ -22,9 +22,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml.Linq;
using static Serein.WorkBench.Themes.TypeViewerWindow;
using static Serein.Workbench.Themes.TypeViewerWindow;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
public class FlowDataDetails

View File

@@ -1,9 +1,9 @@
<Window x:Class="Serein.WorkBench.Themes.TypeViewerWindow"
<Window x:Class="Serein.Workbench.Themes.TypeViewerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
mc:Ignorable="d"
Topmost="True"

View File

@@ -13,7 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// TypeViewerWindow.xaml 的交互逻辑

View File

@@ -1,9 +1,9 @@
<Window x:Class="Serein.WorkBench.Themes.WindowEnvRemoteLoginView"
<Window x:Class="Serein.Workbench.Themes.WindowEnvRemoteLoginView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Serein.WorkBench.Themes"
xmlns:local="clr-namespace:Serein.Workbench.Themes"
Title="登录远程环境" Height="150" Width="200">
<Grid Margin="0,10,0,0">
<Grid.RowDefinitions>

View File

@@ -13,7 +13,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Serein.WorkBench.Themes
namespace Serein.Workbench.Themes
{
/// <summary>
/// WindowDialogInput.xaml 的交互逻辑

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows;
namespace Serein.WorkBench.Tool.Converters
namespace Serein.Workbench.Tool.Converters
{
/// <summary>
/// 根据bool类型控制可见性

View File

@@ -5,7 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace Serein.WorkBench.Tool.Converters
namespace Serein.Workbench.Tool.Converters
{
/// <summary>
/// 画布拉动范围距离计算器

View File

@@ -3,7 +3,7 @@ using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
namespace Serein.WorkBench.Tool.Converters
namespace Serein.Workbench.Tool.Converters
{
/// <summary>
/// 根据控件类型切换颜色

View File

@@ -3,7 +3,7 @@ using System.IO;
using System.Text;
using System.Threading.Channels;
namespace Serein.WorkBench.tool
namespace Serein.Workbench.tool
{
/// <summary>
/// 可以捕获类库输出的打印输出