LocalFlowEnvironment文件丢失,需要重写

This commit is contained in:
fengjiayi
2025-06-22 21:53:37 +08:00
parent 999060b67a
commit 97df2a04b2
58 changed files with 4285 additions and 354 deletions

View File

@@ -27,7 +27,7 @@ namespace Serein.Workbench.Services
/// </summary>
private readonly IFlowEnvironment flowEnvironment;
private readonly IFlowEnvironmentEvent flowEnvironmentEvent;
private readonly UIContextOperation uIContextOperation;
private readonly UIContextOperation uiContextOperation;
/// <summary>
/// 转发流程运行环境各个事件的实现类
@@ -41,7 +41,7 @@ namespace Serein.Workbench.Services
{
this.flowEnvironment = flowEnvironment;
this.flowEnvironmentEvent = flowEnvironmentEvent;
this.uIContextOperation = uIContextOperation;
this.uiContextOperation = uIContextOperation;
InitFlowEnvironmentEvent();
}
@@ -184,7 +184,7 @@ namespace Serein.Workbench.Services
/// <param name="value"></param>
private void FlowEnvironment_OnEnvOutEvent(InfoType type, string value)
{
uIContextOperation.Invoke(() =>
uiContextOperation.Invoke(() =>
{
EnvOutput?.Invoke(type, value);
});
@@ -245,7 +245,10 @@ namespace Serein.Workbench.Services
/// <exception cref="NotImplementedException"></exception>
private void FlowEnvironmentEvent_OnCanvasCreate(CanvasCreateEventArgs eventArgs)
{
CanvasCreated?.Invoke(eventArgs);
uiContextOperation?.Invoke(() =>
{
CanvasCreated?.Invoke(eventArgs);
});
}
/// <summary>

View File

@@ -656,11 +656,7 @@ namespace Serein.Workbench.Services
{
int width = 1200;
int height = 780;
_ = Task.Run(async () =>
{
var result = await flowEnvironment.CreateCanvasAsync("", width, height);
Console.WriteLine(result.Guid);
});
flowEnvironment.CreateCanvas("", width, height);
}
/// <summary>
@@ -673,7 +669,7 @@ namespace Serein.Workbench.Services
return;
}
var model = ((FlowCanvasViewModel)CurrentSelectCanvas.DataContext).Model;
_ = flowEnvironment.RemoveCanvasAsync(model.Guid);
flowEnvironment.RemoveCanvas(model.Guid);
}
/// <summary>
@@ -692,7 +688,7 @@ namespace Serein.Workbench.Services
{
return;
}
_ = flowEnvironment.CreateNodeAsync(canvasGuid, nodeType, position, methodDetailsInfo);
flowEnvironment.CreateNode(canvasGuid, nodeType, position, methodDetailsInfo);
}
/// <summary>
@@ -711,7 +707,7 @@ namespace Serein.Workbench.Services
return;
}
_ = flowEnvironment.RemoveNodeAsync(model.CanvasDetails.Guid, model.Guid);
flowEnvironment.RemoveNode(model.CanvasDetails.Guid, model.Guid);
}
#endregion

View File

@@ -23,6 +23,11 @@ namespace Serein.Workbench.Services
this.flowEnvironment = flowEnvironment;
}
public void StartProjectManagementServer()
{
// CollabrationSideManagement
}
public void LoadLocalProject(string filePath)
{
if (File.Exists(filePath))