mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-30 21:16:35 +08:00
GIT练习
This commit is contained in:
33
WorkBench/Node/ViewModel/ActionNodeControlViewModel.cs
Normal file
33
WorkBench/Node/ViewModel/ActionNodeControlViewModel.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Serein.DynamicFlow;
|
||||
using Serein.DynamicFlow.NodeModel;
|
||||
using Serein.WorkBench.Node.View;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Serein.WorkBench.Node.ViewModel
|
||||
{
|
||||
public class ActionNodeControlViewModel : NodeControlViewModel
|
||||
{
|
||||
private readonly SingleActionNode node;
|
||||
|
||||
public ActionNodeControlViewModel(SingleActionNode node)
|
||||
{
|
||||
this.node = node;
|
||||
|
||||
|
||||
MethodDetails = node.MethodDetails;
|
||||
//if (node.MethodDetails.ExplicitDatas.Length == 0)
|
||||
//{
|
||||
// // 没有显式项
|
||||
// IsExistExplicitData = false;
|
||||
// ExplicitDatas = [];
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// explicitDatas = node.MethodDetails.ExplicitDatas;
|
||||
// //ExplicitDatas = node.MethodDetails.ExplicitDatas;
|
||||
// IsExistExplicitData = true;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
WorkBench/Node/ViewModel/ConditionNodeControlViewModel.cs
Normal file
49
WorkBench/Node/ViewModel/ConditionNodeControlViewModel.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using Serein.DynamicFlow;
|
||||
using Serein.DynamicFlow.NodeModel;
|
||||
using Serein.WorkBench.Node.View;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using static Dm.net.buffer.ByteArrayBuffer;
|
||||
|
||||
namespace Serein.WorkBench.Node.ViewModel
|
||||
{
|
||||
public class ConditionNodeControlViewModel : NodeControlViewModel
|
||||
{
|
||||
private readonly SingleConditionNode singleConditionNode;
|
||||
|
||||
/// <summary>
|
||||
/// 是否为自定义参数
|
||||
/// </summary>
|
||||
public bool IsCustomData
|
||||
{
|
||||
get => singleConditionNode.IsCustomData;
|
||||
set { singleConditionNode.IsCustomData= value; OnPropertyChanged(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 自定义参数值
|
||||
/// </summary>
|
||||
public object? CustomData
|
||||
{
|
||||
get => singleConditionNode.CustomData;
|
||||
set { singleConditionNode.CustomData = value ; OnPropertyChanged(); }
|
||||
}
|
||||
/// <summary>
|
||||
/// 表达式
|
||||
/// </summary>
|
||||
public string Expression
|
||||
{
|
||||
get => singleConditionNode.Expression;
|
||||
set { singleConditionNode.Expression = value; OnPropertyChanged(); }
|
||||
}
|
||||
|
||||
public ConditionNodeControlViewModel(SingleConditionNode node)
|
||||
{
|
||||
this.singleConditionNode = node;
|
||||
MethodDetails = node.MethodDetails;
|
||||
IsCustomData = false;
|
||||
CustomData = "";
|
||||
Expression = "PASS";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
31
WorkBench/Node/ViewModel/ExpOpNodeViewModel.cs
Normal file
31
WorkBench/Node/ViewModel/ExpOpNodeViewModel.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Serein.DynamicFlow.NodeModel;
|
||||
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
|
||||
{
|
||||
public class ExpOpNodeViewModel: NodeControlViewModel
|
||||
{
|
||||
public readonly SingleExpOpNode node;
|
||||
|
||||
public string Expression
|
||||
{
|
||||
get => node.Expression;
|
||||
set
|
||||
{
|
||||
node.Expression = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ExpOpNodeViewModel(SingleExpOpNode node)
|
||||
{
|
||||
this.node = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
WorkBench/Node/ViewModel/FlipflopNodeControlViewModel.cs
Normal file
15
WorkBench/Node/ViewModel/FlipflopNodeControlViewModel.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Serein.DynamicFlow.NodeModel;
|
||||
using Serein.WorkBench.Node.View;
|
||||
|
||||
namespace Serein.WorkBench.Node.ViewModel
|
||||
{
|
||||
public class FlipflopNodeControlViewModel : NodeControlViewModel
|
||||
{
|
||||
private readonly SingleFlipflopNode node;
|
||||
public FlipflopNodeControlViewModel(SingleFlipflopNode node)
|
||||
{
|
||||
this.node = node;
|
||||
MethodDetails = node.MethodDetails;
|
||||
}
|
||||
}
|
||||
}
|
||||
27
WorkBench/Node/ViewModel/TypeToStringConverter.cs
Normal file
27
WorkBench/Node/ViewModel/TypeToStringConverter.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace Serein.WorkBench.Node.ViewModel
|
||||
{
|
||||
public class TypeToStringConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is Type type)
|
||||
{
|
||||
return type.ToString();
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user