mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-28 10:43:21 +08:00
将流程事件接口与流程运行环境解耦。
This commit is contained in:
@@ -78,8 +78,8 @@ namespace Serein.Workbench.Node.ViewModel
|
||||
|
||||
private void InitEvent()
|
||||
{
|
||||
flowEEForwardingService.OnCanvasCreate += (e) => RershCanvass(); // 画布创建了
|
||||
flowEEForwardingService.OnCanvasRemove += (e) => RershCanvass(); // 画布移除了
|
||||
flowEEForwardingService.CanvasCreated += (e) => RershCanvass(); // 画布创建了
|
||||
flowEEForwardingService.CanvasRemoved += (e) => RershCanvass(); // 画布移除了
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Serein.Workbench
|
||||
flowEnvironment.SetUIContextOperation(uIContextOperation);
|
||||
collection.AddSingleton<UIContextOperation>(uIContextOperation); // 注册UI线程操作上下文
|
||||
collection.AddSingleton<IFlowEnvironment>(flowEnvironment); // 注册运行环境
|
||||
collection.AddSingleton<IFlowEnvironmentEvent>(flowEnvironment); // 注册运行环境事件
|
||||
collection.AddSingleton<IFlowEnvironmentEvent>(flowEnvironment.Event); // 注册运行环境事件
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -49,79 +49,75 @@ namespace Serein.Workbench.Services
|
||||
/// <summary>
|
||||
/// 加载了依赖文件事件
|
||||
/// </summary>
|
||||
public event LoadDllHandler? OnDllLoad;
|
||||
public event LoadDllHandler? DllLoad;
|
||||
/// <summary>
|
||||
/// 项目加载完成事件
|
||||
/// </summary>
|
||||
public event ProjectLoadedHandler? OnProjectLoaded;
|
||||
public event ProjectLoadedHandler? ProjectLoaded;
|
||||
/// <summary>
|
||||
/// 项目保存中事件
|
||||
/// </summary>
|
||||
public event ProjectSavingHandler? OnProjectSaving;
|
||||
public event ProjectSavingHandler? ProjectSaving;
|
||||
/// <summary>
|
||||
/// 节点连接改变事件
|
||||
/// </summary>
|
||||
public event NodeConnectChangeHandler? OnNodeConnectChange;
|
||||
public event NodeConnectChangeHandler? NodeConnectChanged;
|
||||
/// <summary>
|
||||
/// 节点创建事件
|
||||
/// </summary>
|
||||
public event NodeCreateHandler? OnNodeCreate;
|
||||
public event NodeCreateHandler? NodeCreated;
|
||||
/// <summary>
|
||||
/// 节点移除事件
|
||||
/// </summary>
|
||||
public event NodeRemoveHandler? OnNodeRemove;
|
||||
public event NodeRemoveHandler? NodeRemoved;
|
||||
/// <summary>
|
||||
/// 节点放置容器事件
|
||||
/// </summary>
|
||||
public event NodePlaceHandler? OnNodePlace;
|
||||
public event NodePlaceHandler? NodePlace;
|
||||
/// <summary>
|
||||
/// 节点取出事件
|
||||
/// </summary>
|
||||
public event NodeTakeOutHandler? OnNodeTakeOut;
|
||||
public event NodeTakeOutHandler? NodeTakeOut;
|
||||
/// <summary>
|
||||
/// 流程起始节点改变事件
|
||||
/// </summary>
|
||||
public event StartNodeChangeHandler? OnStartNodeChange;
|
||||
public event StartNodeChangeHandler? StartNodeChanged;
|
||||
/// <summary>
|
||||
/// 流程运行完毕事件
|
||||
/// </summary>
|
||||
public event FlowRunCompleteHandler? OnFlowRunComplete;
|
||||
public event FlowRunCompleteHandler? FlowRunComplete;
|
||||
/// <summary>
|
||||
/// 被监视的对象数据改变事件
|
||||
/// </summary>
|
||||
public event MonitorObjectChangeHandler? OnMonitorObjectChange;
|
||||
public event MonitorObjectChangeHandler? MonitorObjectChanged;
|
||||
/// <summary>
|
||||
/// 节点中断状态改变事件
|
||||
/// </summary>
|
||||
public event NodeInterruptStateChangeHandler? OnNodeInterruptStateChange;
|
||||
public event NodeInterruptStateChangeHandler? NodeInterruptStateChanged;
|
||||
/// <summary>
|
||||
/// 表达式中断触发事件
|
||||
/// </summary>
|
||||
public event ExpInterruptTriggerHandler? OnInterruptTrigger;
|
||||
public event ExpInterruptTriggerHandler? InterruptTriggered;
|
||||
/// <summary>
|
||||
/// 容器对象改变事件
|
||||
/// </summary>
|
||||
public event IOCMembersChangedHandler? OnIOCMembersChanged;
|
||||
public event IOCMembersChangedHandler? IOCMembersChanged;
|
||||
/// <summary>
|
||||
/// 节点定位事件
|
||||
/// </summary>
|
||||
public event NodeLocatedHandler? OnNodeLocated;
|
||||
/// <summary>
|
||||
/// 节点移动事件
|
||||
/// </summary>
|
||||
public event NodeMovedHandler? OnNodeMoved;
|
||||
public event NodeLocatedHandler? NodeLocated;
|
||||
/// <summary>
|
||||
/// 运行环境输出事件
|
||||
/// </summary>
|
||||
public event EnvOutHandler? OnEnvOut;
|
||||
public event EnvOutHandler? EnvOutput;
|
||||
/// <summary>
|
||||
/// 添加画布事件
|
||||
/// </summary>
|
||||
public event CanvasCreateHandler OnCanvasCreate;
|
||||
public event CanvasCreateHandler CanvasCreated;
|
||||
/// <summary>
|
||||
/// 移除了画布事件
|
||||
/// </summary>
|
||||
public event CanvasRemoveHandler OnCanvasRemove;
|
||||
public event CanvasRemoveHandler CanvasRemoved;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -129,55 +125,53 @@ namespace Serein.Workbench.Services
|
||||
|
||||
private void InitFlowEnvironmentEvent()
|
||||
{
|
||||
flowEnvironmentEvent.OnDllLoad += FlowEnvironment_DllLoadEvent;
|
||||
flowEnvironmentEvent.OnProjectSaving += FlowEnvironment_OnProjectSaving;
|
||||
flowEnvironmentEvent.OnProjectLoaded += FlowEnvironment_OnProjectLoaded;
|
||||
flowEnvironmentEvent.OnCanvasCreate += FlowEnvironmentEvent_OnCanvasCreate;
|
||||
flowEnvironmentEvent.OnCanvasRemove += FlowEnvironmentEvent_OnCanvasRemove;
|
||||
flowEnvironmentEvent.OnStartNodeChange += FlowEnvironment_StartNodeChangeEvent;
|
||||
flowEnvironmentEvent.OnNodeConnectChange += FlowEnvironment_NodeConnectChangeEvemt;
|
||||
flowEnvironmentEvent.OnNodeCreate += FlowEnvironment_NodeCreateEvent;
|
||||
flowEnvironmentEvent.OnNodeRemove += FlowEnvironment_NodeRemoveEvent;
|
||||
flowEnvironmentEvent.OnNodePlace += FlowEnvironment_OnNodePlaceEvent;
|
||||
flowEnvironmentEvent.OnNodeTakeOut += FlowEnvironment_OnNodeTakeOutEvent;
|
||||
flowEnvironmentEvent.OnFlowRunComplete += FlowEnvironment_OnFlowRunCompleteEvent;
|
||||
flowEnvironmentEvent.DllLoad += FlowEnvironment_DllLoadEvent;
|
||||
flowEnvironmentEvent.ProjectSaving += FlowEnvironment_OnProjectSaving;
|
||||
flowEnvironmentEvent.ProjectLoaded += FlowEnvironment_OnProjectLoaded;
|
||||
flowEnvironmentEvent.CanvasCreated += FlowEnvironmentEvent_OnCanvasCreate;
|
||||
flowEnvironmentEvent.CanvasRemoved += FlowEnvironmentEvent_OnCanvasRemove;
|
||||
flowEnvironmentEvent.StartNodeChanged += FlowEnvironment_StartNodeChangeEvent;
|
||||
flowEnvironmentEvent.NodeConnectChanged += FlowEnvironment_NodeConnectChangeEvemt;
|
||||
flowEnvironmentEvent.NodeCreated += FlowEnvironment_NodeCreateEvent;
|
||||
flowEnvironmentEvent.NodeRemoved += FlowEnvironment_NodeRemoveEvent;
|
||||
flowEnvironmentEvent.NodePlace += FlowEnvironment_OnNodePlaceEvent;
|
||||
flowEnvironmentEvent.NodeTakeOut += FlowEnvironment_OnNodeTakeOutEvent;
|
||||
flowEnvironmentEvent.FlowRunComplete += FlowEnvironment_OnFlowRunCompleteEvent;
|
||||
|
||||
flowEnvironmentEvent.OnMonitorObjectChange += FlowEnvironment_OnMonitorObjectChangeEvent;
|
||||
flowEnvironmentEvent.OnNodeInterruptStateChange += FlowEnvironment_OnNodeInterruptStateChangeEvent;
|
||||
flowEnvironmentEvent.OnInterruptTrigger += FlowEnvironment_OnInterruptTriggerEvent;
|
||||
flowEnvironmentEvent.MonitorObjectChanged += FlowEnvironment_OnMonitorObjectChangeEvent;
|
||||
flowEnvironmentEvent.NodeInterruptStateChanged += FlowEnvironment_OnNodeInterruptStateChangeEvent;
|
||||
flowEnvironmentEvent.InterruptTriggered += FlowEnvironment_OnInterruptTriggerEvent;
|
||||
|
||||
flowEnvironmentEvent.OnIOCMembersChanged += FlowEnvironment_OnIOCMembersChangedEvent;
|
||||
flowEnvironmentEvent.IOCMembersChanged += FlowEnvironment_OnIOCMembersChangedEvent;
|
||||
|
||||
flowEnvironmentEvent.OnNodeLocated += FlowEnvironment_OnNodeLocateEvent;
|
||||
flowEnvironmentEvent.OnNodeMoved += FlowEnvironment_OnNodeMovedEvent;
|
||||
flowEnvironmentEvent.NodeLocated += FlowEnvironment_OnNodeLocateEvent;;
|
||||
|
||||
flowEnvironmentEvent.OnEnvOut += FlowEnvironment_OnEnvOutEvent;
|
||||
flowEnvironmentEvent.EnvOutput += FlowEnvironment_OnEnvOutEvent;
|
||||
}
|
||||
|
||||
|
||||
private void ResetFlowEnvironmentEvent()
|
||||
{
|
||||
flowEnvironmentEvent.OnDllLoad -= FlowEnvironment_DllLoadEvent;
|
||||
flowEnvironmentEvent.OnProjectSaving -= FlowEnvironment_OnProjectSaving;
|
||||
flowEnvironmentEvent.OnProjectLoaded -= FlowEnvironment_OnProjectLoaded;
|
||||
flowEnvironmentEvent.OnStartNodeChange -= FlowEnvironment_StartNodeChangeEvent;
|
||||
flowEnvironmentEvent.OnNodeConnectChange -= FlowEnvironment_NodeConnectChangeEvemt;
|
||||
flowEnvironmentEvent.OnNodeCreate -= FlowEnvironment_NodeCreateEvent;
|
||||
flowEnvironmentEvent.OnNodeRemove -= FlowEnvironment_NodeRemoveEvent;
|
||||
flowEnvironmentEvent.OnNodePlace -= FlowEnvironment_OnNodePlaceEvent;
|
||||
flowEnvironmentEvent.OnNodeTakeOut -= FlowEnvironment_OnNodeTakeOutEvent;
|
||||
flowEnvironmentEvent.OnFlowRunComplete -= FlowEnvironment_OnFlowRunCompleteEvent;
|
||||
flowEnvironmentEvent.DllLoad -= FlowEnvironment_DllLoadEvent;
|
||||
flowEnvironmentEvent.ProjectSaving -= FlowEnvironment_OnProjectSaving;
|
||||
flowEnvironmentEvent.ProjectLoaded -= FlowEnvironment_OnProjectLoaded;
|
||||
flowEnvironmentEvent.StartNodeChanged -= FlowEnvironment_StartNodeChangeEvent;
|
||||
flowEnvironmentEvent.NodeConnectChanged -= FlowEnvironment_NodeConnectChangeEvemt;
|
||||
flowEnvironmentEvent.NodeCreated -= FlowEnvironment_NodeCreateEvent;
|
||||
flowEnvironmentEvent.NodeRemoved -= FlowEnvironment_NodeRemoveEvent;
|
||||
flowEnvironmentEvent.NodePlace -= FlowEnvironment_OnNodePlaceEvent;
|
||||
flowEnvironmentEvent.NodeTakeOut -= FlowEnvironment_OnNodeTakeOutEvent;
|
||||
flowEnvironmentEvent.FlowRunComplete -= FlowEnvironment_OnFlowRunCompleteEvent;
|
||||
|
||||
|
||||
flowEnvironmentEvent.OnMonitorObjectChange -= FlowEnvironment_OnMonitorObjectChangeEvent;
|
||||
flowEnvironmentEvent.OnNodeInterruptStateChange -= FlowEnvironment_OnNodeInterruptStateChangeEvent;
|
||||
flowEnvironmentEvent.OnInterruptTrigger -= FlowEnvironment_OnInterruptTriggerEvent;
|
||||
flowEnvironmentEvent.MonitorObjectChanged -= FlowEnvironment_OnMonitorObjectChangeEvent;
|
||||
flowEnvironmentEvent.NodeInterruptStateChanged -= FlowEnvironment_OnNodeInterruptStateChangeEvent;
|
||||
flowEnvironmentEvent.InterruptTriggered -= FlowEnvironment_OnInterruptTriggerEvent;
|
||||
|
||||
flowEnvironmentEvent.OnIOCMembersChanged -= FlowEnvironment_OnIOCMembersChangedEvent;
|
||||
flowEnvironmentEvent.OnNodeLocated -= FlowEnvironment_OnNodeLocateEvent;
|
||||
flowEnvironmentEvent.OnNodeMoved -= FlowEnvironment_OnNodeMovedEvent;
|
||||
flowEnvironmentEvent.IOCMembersChanged -= FlowEnvironment_OnIOCMembersChangedEvent;
|
||||
flowEnvironmentEvent.NodeLocated -= FlowEnvironment_OnNodeLocateEvent;
|
||||
|
||||
flowEnvironmentEvent.OnEnvOut -= FlowEnvironment_OnEnvOutEvent;
|
||||
flowEnvironmentEvent.EnvOutput -= FlowEnvironment_OnEnvOutEvent;
|
||||
|
||||
}
|
||||
|
||||
@@ -192,7 +186,7 @@ namespace Serein.Workbench.Services
|
||||
{
|
||||
uIContextOperation.Invoke(() =>
|
||||
{
|
||||
OnEnvOut?.Invoke(type, value);
|
||||
EnvOutput?.Invoke(type, value);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -203,7 +197,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_OnProjectSaving(ProjectSavingEventArgs eventArgs)
|
||||
{
|
||||
OnProjectSaving?.Invoke(eventArgs);
|
||||
ProjectSaving?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -212,7 +206,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_OnProjectLoaded(ProjectLoadedEventArgs eventArgs)
|
||||
{
|
||||
OnProjectLoaded?.Invoke(eventArgs);
|
||||
ProjectLoaded?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -223,7 +217,7 @@ namespace Serein.Workbench.Services
|
||||
private void FlowEnvironment_OnFlowRunCompleteEvent(FlowEventArgs eventArgs)
|
||||
{
|
||||
SereinEnv.WriteLine(InfoType.INFO, "-------运行完成---------\r\n");
|
||||
OnFlowRunComplete?.Invoke(eventArgs);
|
||||
FlowRunComplete?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -231,7 +225,7 @@ namespace Serein.Workbench.Services
|
||||
/// </summary>
|
||||
private void FlowEnvironment_DllLoadEvent(LoadDllEventArgs eventArgs)
|
||||
{
|
||||
OnDllLoad?.Invoke(eventArgs);
|
||||
DllLoad?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -240,7 +234,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_NodeConnectChangeEvemt(NodeConnectChangeEventArgs eventArgs)
|
||||
{
|
||||
OnNodeConnectChange?.Invoke(eventArgs);
|
||||
NodeConnectChanged?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +245,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironmentEvent_OnCanvasCreate(CanvasCreateEventArgs eventArgs)
|
||||
{
|
||||
OnCanvasCreate?.Invoke(eventArgs);
|
||||
CanvasCreated?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -261,7 +255,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironmentEvent_OnCanvasRemove(CanvasRemoveEventArgs eventArgs)
|
||||
{
|
||||
OnCanvasRemove?.Invoke(eventArgs);
|
||||
CanvasRemoved?.Invoke(eventArgs);
|
||||
|
||||
}
|
||||
|
||||
@@ -271,7 +265,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_NodeRemoveEvent(NodeRemoveEventArgs eventArgs)
|
||||
{
|
||||
OnNodeRemove?.Invoke(eventArgs);
|
||||
NodeRemoved?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -281,7 +275,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_NodeCreateEvent(NodeCreateEventArgs eventArgs)
|
||||
{
|
||||
OnNodeCreate?.Invoke(eventArgs);
|
||||
NodeCreated?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -291,7 +285,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_OnNodePlaceEvent(NodePlaceEventArgs eventArgs)
|
||||
{
|
||||
OnNodePlace?.Invoke(eventArgs);
|
||||
NodePlace?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -300,7 +294,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_OnNodeTakeOutEvent(NodeTakeOutEventArgs eventArgs)
|
||||
{
|
||||
OnNodeTakeOut?.Invoke(eventArgs);
|
||||
NodeTakeOut?.Invoke(eventArgs);
|
||||
|
||||
}
|
||||
|
||||
@@ -312,7 +306,7 @@ namespace Serein.Workbench.Services
|
||||
private void FlowEnvironment_StartNodeChangeEvent(StartNodeChangeEventArgs eventArgs)
|
||||
{
|
||||
|
||||
OnStartNodeChange?.Invoke(eventArgs);
|
||||
StartNodeChanged?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -321,7 +315,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_OnMonitorObjectChangeEvent(MonitorObjectEventArgs eventArgs)
|
||||
{
|
||||
OnMonitorObjectChange?.Invoke(eventArgs);
|
||||
MonitorObjectChanged?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -330,7 +324,7 @@ namespace Serein.Workbench.Services
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_OnNodeInterruptStateChangeEvent(NodeInterruptStateChangeEventArgs eventArgs)
|
||||
{
|
||||
OnNodeInterruptStateChange?.Invoke(eventArgs);
|
||||
NodeInterruptStateChanged?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -340,7 +334,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_OnInterruptTriggerEvent(InterruptTriggerEventArgs eventArgs)
|
||||
{
|
||||
OnInterruptTrigger?.Invoke(eventArgs);
|
||||
InterruptTriggered?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -350,7 +344,7 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_OnIOCMembersChangedEvent(IOCMembersChangedEventArgs eventArgs)
|
||||
{
|
||||
OnIOCMembersChanged?.Invoke(eventArgs);
|
||||
IOCMembersChanged?.Invoke(eventArgs);
|
||||
|
||||
}
|
||||
|
||||
@@ -361,25 +355,110 @@ namespace Serein.Workbench.Services
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
private void FlowEnvironment_OnNodeLocateEvent(NodeLocatedEventArgs eventArgs)
|
||||
{
|
||||
OnNodeLocated?.Invoke(eventArgs);
|
||||
NodeLocated?.Invoke(eventArgs);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点移动
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
private void FlowEnvironment_OnNodeMovedEvent(NodeMovedEventArgs eventArgs)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 主动触发运行环境事件
|
||||
public void OnDllLoad(LoadDllEventArgs eventArgs)
|
||||
{
|
||||
OnNodeMoved?.Invoke(eventArgs);
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnProjectLoaded(ProjectLoadedEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnProjectSaving(ProjectSavingEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeConnectChanged(NodeConnectChangeEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnCanvasCreated(CanvasCreateEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnCanvasRemoved(CanvasRemoveEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeCreated(NodeCreateEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeRemoved(NodeRemoveEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodePlace(NodePlaceEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeTakeOut(NodeTakeOutEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnStartNodeChanged(StartNodeChangeEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnFlowRunComplete(FlowEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnMonitorObjectChanged(MonitorObjectEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeInterruptStateChanged(NodeInterruptStateChangeEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnInterruptTriggered(InterruptTriggerEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnIOCMembersChanged(IOCMembersChangedEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnNodeLocated(NodeLocatedEventArgs eventArgs)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void OnEnvOutput(InfoType type, string value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,17 +190,17 @@ namespace Serein.Workbench.Services
|
||||
/// </summary>
|
||||
private void InitFlowEvent()
|
||||
{
|
||||
flowEEForwardingService.OnCanvasCreate += FlowEEForwardingService_OnCanvasCreate; // 创建了画布
|
||||
flowEEForwardingService.OnCanvasRemove += FlowEEForwardingService_OnCanvasRemove; // 移除了画布
|
||||
flowEEForwardingService.OnNodeCreate += FlowEEForwardingService_OnNodeCreate; // 创建了节点
|
||||
flowEEForwardingService.OnNodeRemove += FlowEEForwardingService_OnNodeRemove; // 移除了节点
|
||||
flowEEForwardingService.CanvasCreated += FlowEEForwardingService_OnCanvasCreate; // 创建了画布
|
||||
flowEEForwardingService.CanvasRemoved += FlowEEForwardingService_OnCanvasRemove; // 移除了画布
|
||||
flowEEForwardingService.NodeCreated += FlowEEForwardingService_OnNodeCreate; // 创建了节点
|
||||
flowEEForwardingService.NodeRemoved += FlowEEForwardingService_OnNodeRemove; // 移除了节点
|
||||
|
||||
flowEEForwardingService.OnNodePlace += FlowEEForwardingService_OnNodePlace; // 节点放置在容器中
|
||||
flowEEForwardingService.OnNodeTakeOut += FlowEEForwardingService_OnNodeTakeOut; ; // 节点从容器中取出
|
||||
flowEEForwardingService.NodePlace += FlowEEForwardingService_OnNodePlace; // 节点放置在容器中
|
||||
flowEEForwardingService.NodeTakeOut += FlowEEForwardingService_OnNodeTakeOut; ; // 节点从容器中取出
|
||||
|
||||
flowEEForwardingService.OnNodeConnectChange += FlowEEForwardingService_OnNodeConnectChange; // 节点连接状态改变事件
|
||||
flowEEForwardingService.NodeConnectChanged += FlowEEForwardingService_OnNodeConnectChange; // 节点连接状态改变事件
|
||||
|
||||
flowEEForwardingService.OnStartNodeChange += FlowEEForwardingService_OnStartNodeChange; // 画布起始节点改变
|
||||
flowEEForwardingService.StartNodeChanged += FlowEEForwardingService_OnStartNodeChange; // 画布起始节点改变
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ namespace Serein.Workbench.Services
|
||||
|
||||
private void InitEvents()
|
||||
{
|
||||
flowEEForwardingService.OnProjectLoaded += FlowEEForwardingService_OnProjectLoaded;
|
||||
flowEEForwardingService.OnProjectSaving += SaveProjectToLocalFile;
|
||||
flowEEForwardingService.OnEnvOut += FlowEEForwardingService_OnEnvOut;
|
||||
flowEEForwardingService.ProjectLoaded += FlowEEForwardingService_OnProjectLoaded;
|
||||
flowEEForwardingService.ProjectSaving += SaveProjectToLocalFile;
|
||||
flowEEForwardingService.EnvOutput += FlowEEForwardingService_OnEnvOut;
|
||||
keyEventService.OnKeyDown += KeyEventService_OnKeyDown; ;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace Serein.Workbench.Themes
|
||||
return;
|
||||
}
|
||||
}));
|
||||
contextMenu.Items.Add(WpfFuncTool.CreateMenuItem("定位", (s, e) => flowEnvironment.NodeLocated(tmpNodeTreeModel.RootNode.Guid)));
|
||||
contextMenu.Items.Add(WpfFuncTool.CreateMenuItem("定位", (s, e) => flowEnvironment.NodeLocate(tmpNodeTreeModel.RootNode.Guid)));
|
||||
|
||||
treeViewItem.ContextMenu = contextMenu;
|
||||
treeViewItem.Margin = new Thickness(-20, 0, 0, 0);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Serein.Workbench.ViewModels
|
||||
this.flowEEForwardingService = flowEEForwardingService;
|
||||
this.flowEnvironment = flowEnvironment;
|
||||
FlowLibraryInfos = new ObservableCollection<FlowLibraryInfo>();
|
||||
flowEEForwardingService.OnDllLoad += FlowEEForwardingService_OnDllLoad;
|
||||
flowEEForwardingService.DllLoad += FlowEEForwardingService_OnDllLoad;
|
||||
}
|
||||
/// <summary>
|
||||
/// 加载文件依赖
|
||||
|
||||
@@ -41,6 +41,7 @@ using UserControl = System.Windows.Controls.UserControl;
|
||||
using Clipboard = System.Windows.Clipboard;
|
||||
using TextDataFormat = System.Windows.TextDataFormat;
|
||||
using System.Windows.Media.Animation;
|
||||
using Serein.NodeFlow.Model;
|
||||
|
||||
namespace Serein.Workbench.Views
|
||||
{
|
||||
@@ -174,7 +175,7 @@ namespace Serein.Workbench.Views
|
||||
private void InitEvent()
|
||||
{
|
||||
keyEventService.OnKeyDown += KeyEventService_OnKeyDown;
|
||||
flowEEForwardingService.OnNodeLocated += FlowEEForwardingService_OnNodeLocated;
|
||||
flowEEForwardingService.NodeLocated += FlowEEForwardingService_OnNodeLocated;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1348,9 +1349,9 @@ namespace Serein.Workbench.Views
|
||||
var actualDeltaX = newLeft - oldLeft;
|
||||
var actualDeltaY = newTop - oldTop;
|
||||
|
||||
List<(string Guid, double NewLeft, double NewTop, double MaxWidth, double MaxHeight)> moveSizes =
|
||||
List<(IFlowNode Node, double NewLeft, double NewTop, double MaxWidth, double MaxHeight)> moveSizes =
|
||||
selectNodeControls.Select(control =>
|
||||
(control.ViewModel.NodeModel.Guid,
|
||||
(control.ViewModel.NodeModel,
|
||||
Canvas.GetLeft(control) + actualDeltaX,
|
||||
Canvas.GetTop(control) + actualDeltaY,
|
||||
control.FlowCanvas.Model.Width - control.ActualWidth - 10,
|
||||
@@ -1363,7 +1364,10 @@ namespace Serein.Workbench.Views
|
||||
}
|
||||
foreach (var item in moveSizes)
|
||||
{
|
||||
this.flowEnvironment.MoveNode(this.Guid, item.Guid, item.NewLeft, item.NewTop); // 移动节点
|
||||
item.Node.Position.X = item.NewLeft;
|
||||
item.Node.Position.Y = item.NewTop;
|
||||
|
||||
//this.flowEnvironment.MoveNode(this.Guid, item.Guid, item.NewLeft, item.NewTop); // 移动节点
|
||||
}
|
||||
|
||||
// 更新节点之间线的连接位置
|
||||
@@ -1390,7 +1394,11 @@ namespace Serein.Workbench.Views
|
||||
newLeft = newLeft < 5 ? 5 : newLeft > canvasWidth ? canvasWidth : newLeft;
|
||||
newTop = newTop < 5 ? 5 : newTop > canvasHeight ? canvasHeight : newTop;
|
||||
|
||||
this.flowEnvironment.MoveNode(Guid, nodeControl.ViewModel.NodeModel.Guid, newLeft, newTop); // 移动节点
|
||||
var node = nodeControl.ViewModel.NodeModel;
|
||||
node.Position.X = newLeft;
|
||||
node.Position.Y = newTop;
|
||||
|
||||
//this.flowEnvironment.MoveNode(Guid, nodeControl.ViewModel.NodeModel.Guid, newLeft, newTop); // 移动节点
|
||||
nodeControl.UpdateLocationConnections();
|
||||
}
|
||||
startControlDragPoint = currentPosition; // 更新起始点位置
|
||||
|
||||
@@ -109,6 +109,14 @@
|
||||
<TextBlock Text="预览位置Y" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding Model.ViewY, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource InfoValueTextBox}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="1" Orientation="Horizontal">
|
||||
<TextBlock Text="缩放比例X" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding Model.ScaleX, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource InfoValueTextBox}"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="1" Orientation="Horizontal">
|
||||
<TextBlock Text="缩放比例Y" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding Model.ScaleY, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource InfoValueTextBox}"/>
|
||||
</StackPanel>
|
||||
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Serein.Workbench.Views
|
||||
if (sender is Grid grid && grid.DataContext is IFlowNode nodeModel)
|
||||
{
|
||||
NodeInfoViewModel.ViewNodeModel = nodeModel;
|
||||
App.GetService<IFlowEnvironment>().NodeLocated(nodeModel.Guid);
|
||||
App.GetService<IFlowEnvironment>().NodeLocate(nodeModel.Guid);
|
||||
}
|
||||
|
||||
// 定位节点
|
||||
|
||||
@@ -41,6 +41,14 @@
|
||||
<TextBlock Text="节点名称" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding ViewNodeModel.DisplayName, Mode=TwoWay}" Style="{StaticResource InfoValueTextBox}" IsReadOnly="True"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="1" Orientation="Horizontal">
|
||||
<TextBlock Text="X轴位置" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding ViewNodeModel.Position.X, Mode=TwoWay}" Style="{StaticResource InfoValueTextBox}" IsReadOnly="True"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="1" Orientation="Horizontal">
|
||||
<TextBlock Text="Y轴位置" Style="{StaticResource InfoTipsTextBlock}" />
|
||||
<TextBox Text="{Binding ViewNodeModel.Position.Y, Mode=TwoWay}" Style="{StaticResource InfoValueTextBox}" IsReadOnly="True"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</UserControl>
|
||||
|
||||
Reference in New Issue
Block a user