mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-03 00:00:49 +08:00
重写了节点的view、viewmodel关系,实现了对画布元素的选取功能,重构了底层依赖,添加了对net .Framework4.6.1以上的Framework类库支持
This commit is contained in:
68
Library.Core/Flow/NodeModel/SingleActionNode.cs
Normal file
68
Library.Core/Flow/NodeModel/SingleActionNode.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
namespace Serein.Flow.NodeModel
|
||||
{
|
||||
/// <summary>
|
||||
/// 单动作节点(用于动作控件)
|
||||
/// </summary>
|
||||
public class SingleActionNode : NodeBase
|
||||
{
|
||||
//public override void Execute(DynamicContext context)
|
||||
//{
|
||||
// try
|
||||
// {
|
||||
// Execute(context, base.MethodDetails);
|
||||
// CurrentState = true;
|
||||
// }
|
||||
// catch (Exception ex)
|
||||
// {
|
||||
// Debug.Write(ex.Message);
|
||||
// CurrentState = false;
|
||||
// }
|
||||
//}
|
||||
|
||||
//public void Execute(DynamicContext context, MethodDetails md)
|
||||
//{
|
||||
// if (DelegateCache.GlobalDicDelegates.TryGetValue(md.MethodName, out Delegate del))
|
||||
// {
|
||||
|
||||
// object? result = null;
|
||||
|
||||
// if (md.ExplicitDatas.Length == 0)
|
||||
// {
|
||||
// if (md.ReturnType == typeof(void))
|
||||
// {
|
||||
// ((Action<object>)del).Invoke(md.ActingInstance);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// result = ((Func<object, object>)del).Invoke(md.ActingInstance);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// object?[]? parameters = GetParameters(context, MethodDetails);
|
||||
// if (md.ReturnType == typeof(void))
|
||||
// {
|
||||
// ((Action<object, object[]>)del).Invoke(md.ActingInstance, parameters);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// result = ((Func<object, object[], object>)del).Invoke(md.ActingInstance, parameters);
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 根据 ExplicitDatas.Length 判断委托类型
|
||||
// //var action = (Action<object, object[]>)del;
|
||||
|
||||
// // 调用委托并获取结果
|
||||
// // action.Invoke(MethodDetails.ActingInstance, parameters);
|
||||
|
||||
// //parameters = [md.ActingInstance, "", 123, ""];
|
||||
|
||||
// context.SetFlowData(result);
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user