mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-08 00:46:34 +08:00
使用emit代替表达式树构造委托。
内置了websocket server与相应的导航功能,可在实例工程中找到相应的实现。
This commit is contained in:
41
Serein.FlowRemoteManagement/FlowRemoteManagement.cs
Normal file
41
Serein.FlowRemoteManagement/FlowRemoteManagement.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
using Serein.Library;
|
||||
using Serein.Library.Entity;
|
||||
using Serein.Library.Api;
|
||||
using Serein.Library.Attributes;
|
||||
using Serein.Library.Enums;
|
||||
using Serein.Library.Network.WebSocketCommunication;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace SereinFlowRemoteManagement
|
||||
{
|
||||
[DynamicFlow]
|
||||
[AutoRegister]
|
||||
public class FlowRemoteManagement
|
||||
{
|
||||
private readonly IFlowEnvironment environment;
|
||||
public FlowRemoteManagement(IFlowEnvironment environment)
|
||||
{
|
||||
this.environment = environment;
|
||||
}
|
||||
|
||||
[NodeAction(NodeType.Init)]
|
||||
public void Init(IDynamicContext context)
|
||||
{
|
||||
environment.IOC.Register<WebSocketServer>();
|
||||
}
|
||||
[NodeAction(NodeType.Loading)]
|
||||
public void Loading(IDynamicContext context)
|
||||
{
|
||||
environment.IOC.Run<WebSocketServer>(async (socketServer) =>
|
||||
{
|
||||
await socketServer.StartAsync("http://*:7525/");
|
||||
});
|
||||
SereinProjectData projectData = environment.SaveProject();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<BaseOutputPath>D:\Project\C#\DynamicControl\SereinFlow\.Output</BaseOutputPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Model\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Library.Core\Serein.Library.Core.csproj" />
|
||||
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user