mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-19 16:06:33 +08:00
运行环境新增了画布相关的属性
This commit is contained in:
@@ -28,7 +28,6 @@ namespace Serein.Library.Api
|
||||
public delegate void ProjectSavingHandler(ProjectSavingEventArgs eventArgs);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载项目文件时成功加载了DLL文件
|
||||
/// </summary>
|
||||
@@ -46,12 +45,34 @@ namespace Serein.Library.Api
|
||||
/// <param name="eventArgs"></param>
|
||||
public delegate void NodeConnectChangeHandler(NodeConnectChangeEventArgs eventArgs);
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 环境中新增了一个画布
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
public delegate void CanvasCreateHandler(CanvasCreateEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// 环境中移除了一个画布
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
public delegate void CanvasRemoveHandler(CanvasRemoveEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// 环境中加载了一个节点
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
public delegate void NodeCreateHandler(NodeCreateEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// 环境中移除了一个节点
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
|
||||
public delegate void NodeRemoveHandler(NodeRemoveEventArgs eventArgs);
|
||||
|
||||
/// <summary>
|
||||
/// 节点放置事件
|
||||
/// </summary>
|
||||
@@ -132,23 +153,9 @@ namespace Serein.Library.Api
|
||||
public string ErrorTips { get; protected set; } = string.Empty;
|
||||
}
|
||||
|
||||
//public class LoadNodeEventArgs : FlowEventArgs
|
||||
//{
|
||||
// public LoadNodeEventArgs(NodeInfo NodeInfo, MethodDetails MethodDetailss)
|
||||
// {
|
||||
// this.NodeInfo = NodeInfo;
|
||||
// this.MethodDetailss = MethodDetailss;
|
||||
// }
|
||||
// /// <summary>
|
||||
// /// 项目文件节点信息参数
|
||||
// /// </summary>
|
||||
// public NodeInfo NodeInfo { get; protected set; }
|
||||
// /// <summary>
|
||||
// /// 已加载在环境中的方法描述
|
||||
// /// </summary>
|
||||
// public MethodDetails MethodDetailss { get; protected set; }
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 项目加载完成
|
||||
/// </summary>
|
||||
public class ProjectLoadedEventArgs : FlowEventArgs
|
||||
{
|
||||
public ProjectLoadedEventArgs()
|
||||
@@ -156,6 +163,9 @@ namespace Serein.Library.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目保存
|
||||
/// </summary>
|
||||
public class ProjectSavingEventArgs : FlowEventArgs
|
||||
{
|
||||
public ProjectSavingEventArgs()
|
||||
@@ -163,6 +173,9 @@ namespace Serein.Library.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载了DLL外部依赖
|
||||
/// </summary>
|
||||
public class LoadDllEventArgs : FlowEventArgs
|
||||
{
|
||||
public LoadDllEventArgs(NodeLibraryInfo nodeLibraryInfo, List<MethodDetailsInfo> MethodDetailss)
|
||||
@@ -180,6 +193,9 @@ namespace Serein.Library.Api
|
||||
public List<MethodDetailsInfo> MethodDetailss { get; protected set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除了DLL外部依赖
|
||||
/// </summary>
|
||||
public class RemoteDllEventArgs : FlowEventArgs
|
||||
{
|
||||
public RemoteDllEventArgs()
|
||||
@@ -187,6 +203,9 @@ namespace Serein.Library.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 改变节点连接关系
|
||||
/// </summary>
|
||||
|
||||
public class NodeConnectChangeEventArgs : FlowEventArgs
|
||||
{
|
||||
@@ -213,12 +232,14 @@ namespace Serein.Library.Api
|
||||
/// <param name="junctionOfConnectionType"></param>
|
||||
/// <param name="connectionInvokeType"></param>
|
||||
/// <param name="changeType"></param>
|
||||
public NodeConnectChangeEventArgs(string fromNodeGuid,
|
||||
public NodeConnectChangeEventArgs(string canvasGuid,
|
||||
string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionOfConnectionType junctionOfConnectionType, // 指示需要创建什么类型的连接线
|
||||
ConnectionInvokeType connectionInvokeType, // 节点调用的方法类型(true/false/error/cancel )
|
||||
ConnectChangeType changeType) // 需要创建连接线还是删除连接线
|
||||
{
|
||||
this.CanvasGuid = canvasGuid;
|
||||
this.FromNodeGuid = fromNodeGuid;
|
||||
this.ToNodeGuid = toNodeGuid;
|
||||
this.ConnectionInvokeType = connectionInvokeType;
|
||||
@@ -235,13 +256,15 @@ namespace Serein.Library.Api
|
||||
/// <param name="argIndex"></param>
|
||||
/// <param name="connectionArgSourceType"></param>
|
||||
/// <param name="changeType"></param>
|
||||
public NodeConnectChangeEventArgs(string fromNodeGuid,
|
||||
public NodeConnectChangeEventArgs(string canvasGuid,
|
||||
string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionOfConnectionType junctionOfConnectionType, // 指示需要创建什么类型的连接线
|
||||
int argIndex,
|
||||
ConnectionArgSourceType connectionArgSourceType, // 节点对应的方法入参所需参数来源
|
||||
ConnectChangeType changeType) // 需要创建连接线还是删除连接线
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
this.FromNodeGuid = fromNodeGuid;
|
||||
this.ToNodeGuid = toNodeGuid;
|
||||
this.ChangeType = changeType;
|
||||
@@ -250,6 +273,9 @@ namespace Serein.Library.Api
|
||||
this.JunctionOfConnectionType = junctionOfConnectionType;
|
||||
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接关系中始节点的Guid
|
||||
/// </summary>
|
||||
@@ -282,7 +308,36 @@ namespace Serein.Library.Api
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加了一个画布
|
||||
/// </summary>
|
||||
public class CanvasCreateEventArgs : FlowEventArgs
|
||||
{
|
||||
public CanvasCreateEventArgs(
|
||||
FlowCanvasInfo info)
|
||||
{
|
||||
Info = info;
|
||||
}
|
||||
|
||||
public FlowCanvasInfo Info { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除了一个画布
|
||||
/// </summary>
|
||||
public class CanvasRemoveEventArgs : FlowEventArgs
|
||||
{
|
||||
public CanvasRemoveEventArgs(string canvasGuid)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加了节点
|
||||
/// </summary>
|
||||
public class NodeCreateEventArgs : FlowEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
@@ -290,31 +345,56 @@ namespace Serein.Library.Api
|
||||
/// </summary>
|
||||
/// <param name="nodeModel">节点对象</param>
|
||||
/// <param name="position">位置</param>
|
||||
public NodeCreateEventArgs(NodeModelBase nodeModel, PositionOfUI position)
|
||||
public NodeCreateEventArgs(string canvasGuid, NodeModelBase nodeModel, PositionOfUI position)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
this.NodeModel = nodeModel;
|
||||
this.Position = position;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点Model对象
|
||||
/// </summary>
|
||||
public NodeModelBase NodeModel { get; private set; }
|
||||
public PositionOfUI Position { get; private set; }
|
||||
//public bool IsAddInRegion { get; private set; }
|
||||
public string RegeionGuid { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 移除了节点的事件
|
||||
/// </summary>
|
||||
public class NodeRemoveEventArgs : FlowEventArgs
|
||||
{
|
||||
public NodeRemoveEventArgs(string canvasGuid, string nodeGuid)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
this.NodeGuid = nodeGuid;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 被移除节点的Guid
|
||||
/// </summary>
|
||||
public string NodeGuid { get; private set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 节点放置事件参数
|
||||
/// </summary>
|
||||
public class NodePlaceEventArgs : FlowEventArgs
|
||||
{
|
||||
public NodePlaceEventArgs(string nodeGuid, string containerNodeGuid)
|
||||
public NodePlaceEventArgs(string canvasGuid, string nodeGuid, string containerNodeGuid)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
NodeGuid = nodeGuid;
|
||||
ContainerNodeGuid = containerNodeGuid;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 子节点,该数据为此次时间的主节点
|
||||
/// </summary>
|
||||
@@ -330,10 +410,14 @@ namespace Serein.Library.Api
|
||||
/// </summary>
|
||||
public class NodeTakeOutEventArgs : FlowEventArgs
|
||||
{
|
||||
public NodeTakeOutEventArgs(string nodeGuid)
|
||||
public NodeTakeOutEventArgs(string canvasGuid, string nodeGuid)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
NodeGuid = nodeGuid;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 需要取出的节点Guid
|
||||
/// </summary>
|
||||
@@ -341,34 +425,21 @@ namespace Serein.Library.Api
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 环境中移除了一个节点
|
||||
/// </summary>
|
||||
/// <param name="eventArgs"></param>
|
||||
|
||||
public delegate void NodeRemoveHandler(NodeRemoveEventArgs eventArgs);
|
||||
public class NodeRemoveEventArgs : FlowEventArgs
|
||||
{
|
||||
public NodeRemoveEventArgs(string nodeGuid)
|
||||
{
|
||||
this.NodeGuid = nodeGuid;
|
||||
}
|
||||
/// <summary>
|
||||
/// 被移除节点的Guid
|
||||
/// </summary>
|
||||
public string NodeGuid { get; private set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public class StartNodeChangeEventArgs : FlowEventArgs
|
||||
{
|
||||
public StartNodeChangeEventArgs(string oldNodeGuid, string newNodeGuid)
|
||||
public StartNodeChangeEventArgs(string canvasGuid, string oldNodeGuid, string newNodeGuid)
|
||||
{
|
||||
CanvasGuid = canvasGuid;
|
||||
this.OldNodeGuid = oldNodeGuid;
|
||||
this.NewNodeGuid = newNodeGuid; ;
|
||||
}
|
||||
|
||||
public string CanvasGuid { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 原来的起始节点Guid
|
||||
/// </summary>
|
||||
@@ -577,6 +648,16 @@ namespace Serein.Library.Api
|
||||
/// </summary>
|
||||
event NodeConnectChangeHandler OnNodeConnectChange;
|
||||
|
||||
/// <summary>
|
||||
/// 增加画布事件
|
||||
/// </summary>
|
||||
event CanvasCreateHandler OnCanvasCreate;
|
||||
|
||||
/// <summary>
|
||||
/// 删除画布事件
|
||||
/// </summary>
|
||||
event CanvasRemoveHandler OnCanvasRemove;
|
||||
|
||||
/// <summary>
|
||||
/// 节点创建事件
|
||||
/// </summary>
|
||||
@@ -793,20 +874,37 @@ namespace Serein.Library.Api
|
||||
|
||||
#region 流程节点操作接口
|
||||
|
||||
/// <summary>
|
||||
/// 增加画布
|
||||
/// </summary>
|
||||
/// <param name="canvasName">画布名称</param>
|
||||
/// <param name="width">宽度</param>
|
||||
/// <param name="height">高度</param>
|
||||
/// <returns></returns>
|
||||
Task<FlowCanvasInfo> CreateCanvasAsync(string canvasName, int width , int height);
|
||||
|
||||
/// <summary>
|
||||
/// 删除画布
|
||||
/// </summary>
|
||||
/// <param name="canvasGuid">画布Guid</param>
|
||||
/// <returns></returns>
|
||||
Task<bool> RemoteCanvasAsync(string canvasGuid);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 移动了某个节点(远程插件使用)
|
||||
/// </summary>
|
||||
/// <param name="nodeGuid"></param>
|
||||
/// <param name="x"></param>
|
||||
/// <param name="y"></param>
|
||||
void MoveNode(string nodeGuid,double x, double y);
|
||||
void MoveNode(string canvasGuid, string nodeGuid, double x, double y);
|
||||
|
||||
/// <summary>
|
||||
/// 设置流程起点节点
|
||||
/// </summary>
|
||||
/// <param name="nodeGuid">尝试设置为起始节点的节点Guid</param>
|
||||
/// <returns>被设置为起始节点的Guid</returns>
|
||||
Task<string> SetStartNodeAsync(string nodeGuid);
|
||||
Task<string> SetStartNodeAsync(string canvasGuid, string nodeGuid);
|
||||
|
||||
/// <summary>
|
||||
/// 在两个节点之间创建连接关系
|
||||
@@ -816,11 +914,12 @@ namespace Serein.Library.Api
|
||||
/// <param name="fromNodeJunctionType">起始节点控制点</param>
|
||||
/// <param name="toNodeJunctionType">目标节点控制点</param>
|
||||
/// <param name="invokeType">决定了方法执行后的后继行为</param>
|
||||
Task<bool> ConnectInvokeNodeAsync(string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionType fromNodeJunctionType,
|
||||
JunctionType toNodeJunctionType,
|
||||
ConnectionInvokeType invokeType);
|
||||
Task<bool> ConnectInvokeNodeAsync(string canvasGuid,
|
||||
string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionType fromNodeJunctionType,
|
||||
JunctionType toNodeJunctionType,
|
||||
ConnectionInvokeType invokeType);
|
||||
|
||||
/// <summary>
|
||||
/// 在两个节点之间创建连接关系
|
||||
@@ -831,12 +930,13 @@ namespace Serein.Library.Api
|
||||
/// <param name="toNodeJunctionType">目标节点控制点</param>
|
||||
/// <param name="argSourceType">决定了方法参数来源</param>
|
||||
/// <param name="argIndex">设置第几个参数</param>
|
||||
Task<bool> ConnectArgSourceNodeAsync(string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionType fromNodeJunctionType,
|
||||
JunctionType toNodeJunctionType,
|
||||
ConnectionArgSourceType argSourceType,
|
||||
int argIndex);
|
||||
Task<bool> ConnectArgSourceNodeAsync(string canvasGuid,
|
||||
string fromNodeGuid,
|
||||
string toNodeGuid,
|
||||
JunctionType fromNodeJunctionType,
|
||||
JunctionType toNodeJunctionType,
|
||||
ConnectionArgSourceType argSourceType,
|
||||
int argIndex);
|
||||
|
||||
|
||||
|
||||
@@ -846,19 +946,19 @@ namespace Serein.Library.Api
|
||||
/// <param name="nodeType">控件类型</param>
|
||||
/// <param name="position">节点在画布上的位置(</param>
|
||||
/// <param name="methodDetailsInfo">节点绑定的方法说明</param>
|
||||
Task<NodeInfo> CreateNodeAsync(NodeControlType nodeType, PositionOfUI position, MethodDetailsInfo methodDetailsInfo = null);
|
||||
Task<NodeInfo> CreateNodeAsync(string canvasGuid, NodeControlType nodeType, PositionOfUI position, MethodDetailsInfo methodDetailsInfo = null);
|
||||
|
||||
/// <summary>
|
||||
/// 将节点放置在容器中
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> PlaceNodeToContainerAsync(string nodeGuid, string containerNodeGuid);
|
||||
Task<bool> PlaceNodeToContainerAsync(string canvasGuid, string nodeGuid, string containerNodeGuid);
|
||||
|
||||
/// <summary>
|
||||
/// 将节点从容器中脱离
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
Task<bool> TakeOutNodeToContainerAsync(string nodeGuid);
|
||||
Task<bool> TakeOutNodeToContainerAsync(string canvasGuid, string nodeGuid);
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -876,7 +976,7 @@ namespace Serein.Library.Api
|
||||
/// <param name="fromNodeGuid">起始节点</param>
|
||||
/// <param name="toNodeGuid">目标节点</param>
|
||||
/// <param name="connectionType">连接类型</param>
|
||||
Task<bool> RemoveConnectInvokeAsync(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType);
|
||||
Task<bool> RemoveConnectInvokeAsync(string canvasGuid, string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType);
|
||||
|
||||
/// <summary>
|
||||
/// 移除连接节点之间参数传递的关系
|
||||
@@ -885,13 +985,13 @@ namespace Serein.Library.Api
|
||||
/// <param name="toNodeGuid">目标节点Guid</param>
|
||||
/// <param name="argIndex">连接到第几个参数</param>
|
||||
/// <param name="connectionArgSourceType">参数来源类型</param>
|
||||
Task<bool> RemoveConnectArgSourceAsync(string fromNodeGuid, string toNodeGuid, int argIndex);
|
||||
Task<bool> RemoveConnectArgSourceAsync(string canvasGuid, string fromNodeGuid, string toNodeGuid, int argIndex);
|
||||
|
||||
/// <summary>
|
||||
/// 移除节点/区域/基础控件
|
||||
/// </summary>
|
||||
/// <param name="nodeGuid">待移除的节点Guid</param>
|
||||
Task<bool> RemoveNodeAsync(string nodeGuid);
|
||||
Task<bool> RemoveNodeAsync(string canvasGuid, string nodeGuid);
|
||||
|
||||
/// <summary>
|
||||
/// 改变可选参数的数目
|
||||
|
||||
@@ -7,14 +7,52 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Serein.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// 节点方法拓展
|
||||
/// </summary>
|
||||
public static class NodeModelExtension
|
||||
public static class FlowModelExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// 导出为画布信息
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public static FlowCanvasInfo ToInfo(this FlowCanvasModel model)
|
||||
{
|
||||
return new FlowCanvasInfo
|
||||
{
|
||||
Guid = model.Guid,
|
||||
Height = model.Height,
|
||||
Width = model.Width,
|
||||
Name = model.Name,
|
||||
ScaleX = model.ScaleX,
|
||||
ScaleY = model.ScaleY,
|
||||
ViewX = model.ViewX,
|
||||
ViewY = model.ViewY,
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从画布信息加载
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <param name="info"></param>
|
||||
public static void LoadInfo(this FlowCanvasModel model, FlowCanvasInfo info)
|
||||
{
|
||||
model.Guid = info.Guid;
|
||||
model.Height = info.Height;
|
||||
model.Width = info.Width;
|
||||
model.Name = info.Name;
|
||||
model.ScaleX = info.ScaleX;
|
||||
model.ScaleY = info.ScaleY;
|
||||
model.ViewX = info.ViewX;
|
||||
model.ViewY = info.ViewY;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 输出方法参数信息
|
||||
/// </summary>
|
||||
@@ -1,390 +0,0 @@
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Library
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 不提供流程操作能力,仅提供容器功能
|
||||
/// </summary>
|
||||
public class ContainerFlowEnvironment : IFlowEnvironment, ISereinIOC
|
||||
{
|
||||
/// <summary>
|
||||
/// 本地运行环境缓存的持久化实例
|
||||
/// </summary>
|
||||
private Dictionary<string, object> PersistennceInstance { get; } = new Dictionary<string, object>();
|
||||
public ContainerFlowEnvironment()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private ISereinIOC sereinIOC => this;
|
||||
public ISereinIOC IOC => sereinIOC;
|
||||
|
||||
public string EnvName => throw new NotImplementedException();
|
||||
public string ProjectFileLocation => throw new NotImplementedException();
|
||||
|
||||
public bool IsGlobalInterrupt => throw new NotImplementedException();
|
||||
|
||||
public bool IsControlRemoteEnv => throw new NotImplementedException();
|
||||
|
||||
public InfoClass InfoClass { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public RunState FlowState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
public RunState FlipFlopState { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }
|
||||
|
||||
public IFlowEnvironment CurrentEnv => this;
|
||||
|
||||
public UIContextOperation UIContextOperation { get; set; }
|
||||
public NodeMVVMManagement NodeMVVMManagement { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 设置在UI线程操作的线程上下文
|
||||
/// </summary>
|
||||
/// <param name="uiContextOperation"></param>
|
||||
public void SetUIContextOperation(UIContextOperation uiContextOperation)
|
||||
{
|
||||
this.UIContextOperation = uiContextOperation;
|
||||
}
|
||||
|
||||
public void ActivateFlipflopNode(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> ChangeParameter(string nodeGuid, bool isAdd, int paramIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> ConnectArgSourceNodeAsync(string fromNodeGuid, string toNodeGuid, JunctionType fromNodeJunctionType, JunctionType toNodeJunctionType, ConnectionArgSourceType argSourceType, int argIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> ConnectInvokeNodeAsync(string fromNodeGuid, string toNodeGuid, JunctionType fromNodeJunctionType, JunctionType toNodeJunctionType, ConnectionInvokeType invokeType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<(bool, RemoteMsgUtil)> ConnectRemoteEnv(string addres, int port, string token)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<NodeInfo> CreateNodeAsync(NodeControlType nodeType, PositionOfUI position, MethodDetailsInfo methodDetailsInfo = null)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> ExitFlowAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void ExitRemoteEnv()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<FlowEnvInfo> GetEnvInfoAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<SereinProjectData> GetProjectInfoAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<object> InvokeNodeAsync(IDynamicContext context, string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void LoadAllNativeLibraryOfRuning(string path, bool isRecurrence = true)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void LoadLibrary(string dllPath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool LoadNativeLibraryOfRuning(string file)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task LoadNodeInfosAsync(List<NodeInfo> nodeInfos)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void LoadProject(FlowEnvInfo flowEnvInfo, string filePath)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void MonitorObjectNotification(string nodeGuid, object monitorData, MonitorObjectEventArgs.ObjSourceType sourceType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void MoveNode(string nodeGuid, double x, double y)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void NodeLocated(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task NotificationNodeValueChangeAsync(string nodeGuid, string path, object value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> PlaceNodeToContainerAsync(string nodeGuid, string containerNodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> RemoveConnectArgSourceAsync(string fromNodeGuid, string toNodeGuid, int argIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> RemoveConnectInvokeAsync(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> RemoveNodeAsync(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void SaveProject()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> SetConnectPriorityInvoke(string fromNodeGuid, string toNodeGuid, ConnectionInvokeType connectionType)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<string> SetStartNodeAsync(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> StartAsyncInSelectNode(string startNodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> StartFlowAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task StartRemoteServerAsync(int port = 7525)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void StopRemoteServer()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Task<bool> TakeOutNodeToContainerAsync(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void TerminateFlipflopNode(string nodeGuid)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void TriggerInterrupt(string nodeGuid, string expression, InterruptTriggerEventArgs.InterruptTriggerType type)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TryGetDelegateDetails(string assemblyName, string methodName, out DelegateDetails del)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TryGetMethodDetailsInfo(string assemblyName, string methodName, out MethodDetailsInfo mdInfo)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool TryUnloadLibrary(string assemblyFullName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public void WriteLine(InfoType type, string message, InfoClass @class = InfoClass.Trivial)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region IOC容器相关
|
||||
ISereinIOC ISereinIOC.Reset()
|
||||
{
|
||||
sereinIOC.Reset();
|
||||
lock (PersistennceInstance)
|
||||
{
|
||||
foreach (var kvp in PersistennceInstance)
|
||||
{
|
||||
IOC.RegisterPersistennceInstance(kvp.Key, kvp.Value);
|
||||
}
|
||||
} // 重置后重新登记
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Register(Type type, params object[] parameters)
|
||||
{
|
||||
sereinIOC.Register(type, parameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Register<T>(params object[] parameters)
|
||||
{
|
||||
sereinIOC.Register<T>(parameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Register<TService, TImplementation>(params object[] parameters)
|
||||
{
|
||||
sereinIOC.Register<TService, TImplementation>(parameters);
|
||||
return this;
|
||||
}
|
||||
|
||||
//T ISereinIOC.GetOrRegisterInstantiate<T>()
|
||||
//{
|
||||
// return sereinIOC.GetOrRegisterInstantiate<T>();
|
||||
|
||||
//}
|
||||
|
||||
//object ISereinIOC.GetOrRegisterInstantiate(Type type)
|
||||
//{
|
||||
// return sereinIOC.GetOrRegisterInstantiate(type);
|
||||
//}
|
||||
|
||||
object ISereinIOC.Get(Type type)
|
||||
{
|
||||
return sereinIOC.Get(type);
|
||||
|
||||
}
|
||||
T ISereinIOC.Get<T>()
|
||||
{
|
||||
return (T)sereinIOC.Get(typeof(T));
|
||||
}
|
||||
//T ISereinIOC.Get<T>(string key)
|
||||
//{
|
||||
// return sereinIOC.Get<T>(key);
|
||||
//}
|
||||
|
||||
|
||||
bool ISereinIOC.RegisterPersistennceInstance(string key, object instance)
|
||||
{
|
||||
if (PersistennceInstance.ContainsKey(key))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
PersistennceInstance.Add(key, instance); // 记录需要持久化的实例
|
||||
return sereinIOC.RegisterPersistennceInstance(key, instance);
|
||||
}
|
||||
|
||||
//bool ISereinIOC.RegisterInstance(string key, object instance)
|
||||
//{
|
||||
// return sereinIOC.RegisterInstance(key, instance);
|
||||
//}
|
||||
|
||||
|
||||
object ISereinIOC.Instantiate(Type type)
|
||||
{
|
||||
return sereinIOC.Instantiate(type);
|
||||
}
|
||||
T ISereinIOC.Instantiate<T>()
|
||||
{
|
||||
return sereinIOC.Instantiate<T>();
|
||||
}
|
||||
ISereinIOC ISereinIOC.Build()
|
||||
{
|
||||
sereinIOC.Build();
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T>(Action<T> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2>(Action<T1, T2> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3>(Action<T1, T2, T3> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3, T4>(Action<T1, T2, T3, T4> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3, T4, T5>(Action<T1, T2, T3, T4, T5> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3, T4, T5, T6>(Action<T1, T2, T3, T4, T5, T6> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3, T4, T5, T6, T7>(Action<T1, T2, T3, T4, T5, T6, T7> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
ISereinIOC ISereinIOC.Run<T1, T2, T3, T4, T5, T6, T7, T8>(Action<T1, T2, T3, T4, T5, T6, T7, T8> action)
|
||||
{
|
||||
sereinIOC.Run(action);
|
||||
return this;
|
||||
}
|
||||
|
||||
public bool TryGetNodeModel(string nodeGuid, out NodeModelBase nodeModel)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
57
Library/FlowNode/FlowCanvasModel.cs
Normal file
57
Library/FlowNode/FlowCanvasModel.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Serein.Library.Api;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Library
|
||||
{
|
||||
|
||||
[NodeProperty(ValuePath = NodeValuePath.Node)]
|
||||
public partial class FlowCanvasModel
|
||||
{
|
||||
public FlowCanvasModel(IFlowEnvironment env)
|
||||
{
|
||||
Env = env;
|
||||
}
|
||||
public IFlowEnvironment Env { get; }
|
||||
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private string _guid;
|
||||
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private string _name;
|
||||
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _width;
|
||||
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _height;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置X
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _viewX ;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置Y
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _viewY ;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例X
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _scaleX ;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例Y
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _scaleY ;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,14 @@ namespace Serein.Library
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private NodeControlType _controlType;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 所属画布
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private string _canvasGuid ;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 在画布中的位置
|
||||
/// </summary>
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Serein.Library
|
||||
/// 画布
|
||||
/// </summary>
|
||||
|
||||
public FlowCanvas Canvas { get; set; }
|
||||
public FlowCanvasInfo Canvas { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本
|
||||
@@ -98,8 +98,12 @@ namespace Serein.Library
|
||||
/// <summary>
|
||||
/// 画布信息,项目文件相关
|
||||
/// </summary>
|
||||
public class FlowCanvas
|
||||
public class FlowCanvasInfo
|
||||
{
|
||||
public string Guid { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 宽度
|
||||
/// </summary>
|
||||
@@ -178,6 +182,12 @@ namespace Serein.Library
|
||||
/// </summary>
|
||||
public class NodeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 所属画布Guid
|
||||
/// </summary>
|
||||
public string CanvasGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点的GUID
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user