尝试将节点流导出为c#代码文件

This commit is contained in:
fengjiayi
2025-07-06 14:34:49 +08:00
parent 162dc7bcf8
commit b25fd9c83c
45 changed files with 1625 additions and 361 deletions

View File

@@ -15,8 +15,6 @@ namespace Serein.Workbench.Services
{
private readonly IFlowEnvironment flowEnvironment;
public SereinProjectData? FlowProjectData { get; set; }
public string FileDataPath { get; set; }
public FlowProjectService(IFlowEnvironment flowEnvironment)
{
@@ -32,15 +30,13 @@ namespace Serein.Workbench.Services
{
if (File.Exists(filePath))
{
string content = System.IO.File.ReadAllText(filePath); // 读取整个文件内容
this.FlowProjectData = JsonConvert.DeserializeObject<SereinProjectData>(content);
this.FileDataPath = System.IO.Path.GetDirectoryName(filePath)!; // filePath;//
/*
var dir = Path.GetDirectoryName(filePath);
var flowEnvInfo = new FlowEnvInfo
{
Project = FlowProjectData,
};
flowEnvironment.LoadProject(flowEnvInfo, FileDataPath);
};*/
flowEnvironment.LoadProject(filePath);
}
}