mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-14 21:46:35 +08:00
在ChannelFlowTrigger的基础上添加了观察者模式,使其具备通知多个消费者的能力。
This commit is contained in:
@@ -59,15 +59,10 @@ namespace Net462DllTest.LogicControl
|
||||
this.ViewManagement = ViewManagement;
|
||||
}
|
||||
|
||||
[NodeAction(NodeType.Init)]
|
||||
public void Init(IDynamicContext context)
|
||||
{
|
||||
context.Env.IOC.Register<ViewManagement>();
|
||||
}
|
||||
|
||||
#region 触发器节点
|
||||
|
||||
[NodeAction(NodeType.Flipflop, "等待信号触发", ReturnType = typeof(int))]
|
||||
[NodeAction(NodeType.Flipflop, "等待视图命令", ReturnType = typeof(int))]
|
||||
public async Task<IFlipflopContext> WaitTask(CommandSignal command = CommandSignal.Command_1)
|
||||
{
|
||||
try
|
||||
@@ -91,26 +86,29 @@ namespace Net462DllTest.LogicControl
|
||||
}
|
||||
|
||||
#endregion
|
||||
[NodeAction(NodeType.Action, "打开窗体(指定枚举值)")]
|
||||
public void OpenForm(IDynamicContext context, FromValue fromId = FromValue.FromWorkBenchView, bool isTop = true)
|
||||
{
|
||||
var fromType = EnumHelper.GetBoundValue<FromValue, Type>(fromId, attr => attr.Value);
|
||||
if (fromType is null) return;
|
||||
if (context.Env.IOC.Instantiate(fromType) is Form form)
|
||||
{
|
||||
ViewManagement.OpenView(form, isTop);
|
||||
}
|
||||
}
|
||||
//[NodeAction(NodeType.Action, "打开窗体(指定枚举值)")]
|
||||
//public void OpenForm(IDynamicContext context,
|
||||
// FromValue fromId = FromValue.FromWorkBenchView,
|
||||
// bool isTop = true)
|
||||
//{
|
||||
// var fromType = EnumHelper.GetBoundValue<FromValue, Type>(fromId, attr => attr.Value);
|
||||
// if (fromType is null) return;
|
||||
// if (context.Env.IOC.Instantiate(fromType) is Form form)
|
||||
// {
|
||||
// ViewManagement.OpenView(form, isTop);
|
||||
// }
|
||||
//}
|
||||
|
||||
[NodeAction(NodeType.Action, "打开窗体(使用转换器)")]
|
||||
[NodeAction(NodeType.Action, "打开窗体(转换器)")]
|
||||
public void OpenForm2([EnumTypeConvertor(typeof(FromValue))] Form form, bool isTop = true)
|
||||
{
|
||||
// 枚举转换为对应的Type并自动实例化
|
||||
ViewManagement.OpenView(form, isTop);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[NodeAction(NodeType.Action, "关闭窗体")]
|
||||
[NodeAction(NodeType.Action, "关闭指定类型的所有窗体")]
|
||||
public void CloseForm(IDynamicContext context, FromValue fromId = FromValue.FromWorkBenchView)
|
||||
{
|
||||
var fromType = EnumHelper.GetBoundValue<FromValue, Type>(fromId, attr => attr.Value);
|
||||
|
||||
Reference in New Issue
Block a user