mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-20 16:26:34 +08:00
完成mvvm模式下,画布、节点编辑的基本重构
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.FlowNode;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -8,50 +9,86 @@ using System.Threading.Tasks;
|
||||
namespace Serein.Library
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 流程画布
|
||||
/// </summary>
|
||||
[NodeProperty(ValuePath = NodeValuePath.Node)]
|
||||
public partial class FlowCanvasModel
|
||||
public partial class FlowCanvasDetails
|
||||
{
|
||||
public FlowCanvasModel(IFlowEnvironment env)
|
||||
public FlowCanvasDetails(IFlowEnvironment env)
|
||||
{
|
||||
Env = env;
|
||||
}
|
||||
|
||||
public IFlowEnvironment Env { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 标识画布ID
|
||||
/// </summary>
|
||||
[PropertyInfo(IsProtection = true)]
|
||||
private string _guid;
|
||||
|
||||
/// <summary>
|
||||
/// 画布名称
|
||||
/// </summary>
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private string _name;
|
||||
|
||||
/// <summary>
|
||||
/// 画布宽度
|
||||
/// </summary>
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _width;
|
||||
|
||||
/// <summary>
|
||||
/// 画布高度
|
||||
/// </summary>
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _height;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置X
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _viewX ;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置Y
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _viewY ;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例X
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _scaleX ;
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _scaleX = 1;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例Y
|
||||
/// </summary>
|
||||
[PropertyInfo]
|
||||
private double _scaleY ;
|
||||
[PropertyInfo(IsNotification = true)]
|
||||
private double _scaleY = 1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 起始节点私有属性
|
||||
/// </summary>
|
||||
private string _startNode;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public partial class FlowCanvasDetails
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
60
Library/FlowNode/FlowCanvasDetailsInfo.cs
Normal file
60
Library/FlowNode/FlowCanvasDetailsInfo.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Serein.Library
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 画布信息
|
||||
/// </summary>
|
||||
public class FlowCanvasDetailsInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// 起始节点Guid
|
||||
/// </summary>
|
||||
public string StartNode;
|
||||
|
||||
/// <summary>
|
||||
/// 标识画布ID
|
||||
/// </summary>
|
||||
public string Guid;
|
||||
|
||||
/// <summary>
|
||||
/// 画布名称
|
||||
/// </summary>
|
||||
public string Name;
|
||||
|
||||
/// <summary>
|
||||
/// 画布宽度
|
||||
/// </summary>
|
||||
public double Width;
|
||||
|
||||
/// <summary>
|
||||
/// 画布高度
|
||||
/// </summary>
|
||||
public double Height;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置X
|
||||
/// </summary>
|
||||
public double ViewX;
|
||||
|
||||
/// <summary>
|
||||
/// 预览位置Y
|
||||
/// </summary>
|
||||
public double ViewY;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例X
|
||||
/// </summary>
|
||||
public double ScaleX;
|
||||
|
||||
/// <summary>
|
||||
/// 缩放比例Y
|
||||
/// </summary>
|
||||
public double ScaleY;
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ namespace Serein.Library
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目保存文件
|
||||
/// 项目数据
|
||||
/// </summary>
|
||||
public class SereinProjectData
|
||||
{
|
||||
@@ -64,16 +64,20 @@ namespace Serein.Library
|
||||
|
||||
public NodeLibraryInfo[] Librarys { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 起始节点GUID
|
||||
/// </summary>
|
||||
///// <summary>
|
||||
///// 起始节点GUID
|
||||
///// </summary>
|
||||
|
||||
public string StartNode { get; set; }
|
||||
//public string StartNode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 画布集合
|
||||
/// </summary>
|
||||
public FlowCanvasDetailsInfo[] Canvass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点集合
|
||||
/// </summary>
|
||||
|
||||
public NodeInfo[] Nodes { get; set; }
|
||||
|
||||
}
|
||||
@@ -83,11 +87,10 @@ namespace Serein.Library
|
||||
/// </summary>
|
||||
public class Basic
|
||||
{
|
||||
/// <summary>
|
||||
/// 画布
|
||||
/// </summary>
|
||||
|
||||
public FlowCanvasInfo Canvas { get; set; }
|
||||
///// <summary>
|
||||
///// 画布
|
||||
///// </summary>
|
||||
//public FlowCanvasInfo Canvas { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 版本
|
||||
@@ -95,7 +98,9 @@ namespace Serein.Library
|
||||
|
||||
public string Versions { get; set; }
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
|
||||
/* /// <summary>
|
||||
/// 画布信息,项目文件相关
|
||||
/// </summary>
|
||||
public class FlowCanvasInfo
|
||||
@@ -132,7 +137,7 @@ namespace Serein.Library
|
||||
/// 缩放比例Y
|
||||
/// </summary>
|
||||
public double ScaleY { get; set; }
|
||||
}
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// 项目依赖的程序集,项目文件相关
|
||||
@@ -187,7 +192,6 @@ namespace Serein.Library
|
||||
/// </summary>
|
||||
public string CanvasGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 节点的GUID
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user