mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-30 13:06:34 +08:00
尝试将节点流导出为c#代码文件
This commit is contained in:
@@ -5,6 +5,7 @@ using Serein.NodeFlow.Model;
|
||||
using System.Collections.Concurrent;
|
||||
using System.ComponentModel;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace Serein.NodeFlow
|
||||
{
|
||||
@@ -128,6 +129,32 @@ namespace Serein.NodeFlow
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加代码
|
||||
/// </summary>
|
||||
/// <param name="sb">字符串构建器</param>
|
||||
/// <param name="retractCount">缩进次数(4个空格)</param>
|
||||
/// <param name="code">要添加的代码</param>
|
||||
/// <returns>字符串构建器本身</returns>
|
||||
public static StringBuilder AddCode(this StringBuilder sb,
|
||||
int retractCount = 0,
|
||||
string code = null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(code))
|
||||
{
|
||||
var retract = new string(' ', retractCount * 4);
|
||||
sb.AppendLine(retract + code);
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///// <summary>
|
||||
///// 从节点类型枚举中转为对应的 Model 类型
|
||||
///// </summary>
|
||||
@@ -165,4 +192,6 @@ namespace Serein.NodeFlow
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user