mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-15 20:36:35 +08:00
小修小改
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Serein.Library.Utils
|
|||||||
/// 使用第三方包进行解析
|
/// 使用第三方包进行解析
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="jsonPortal"></param>
|
/// <param name="jsonPortal"></param>
|
||||||
public static void UseJsonLibrary(IJsonProvider jsonPortal)
|
public static void UseJsonProvider(IJsonProvider jsonPortal)
|
||||||
{
|
{
|
||||||
JsonHelper.provider = jsonPortal;
|
JsonHelper.provider = jsonPortal;
|
||||||
}
|
}
|
||||||
|
|||||||
18
Serein.Extend.NewtonsoftJson/NewtonsoftJsonExtend.cs
Normal file
18
Serein.Extend.NewtonsoftJson/NewtonsoftJsonExtend.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
using Serein.Library.Utils;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Serein.Extend.NewtonsoftJson
|
||||||
|
{
|
||||||
|
public static class NewtonsoftJsonExtend
|
||||||
|
{
|
||||||
|
public static string ToJsonText(this object data)
|
||||||
|
{
|
||||||
|
return JsonHelper.Serialize(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -14,8 +14,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.Library", "Library\Serein.Library.csproj", "{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.Library", "Library\Serein.Library.csproj", "{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Net462DllTest", "Net462DllTest\Net462DllTest.csproj", "{E40EE629-1A38-4011-88E3-9AD036869987}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.FlowStartTool", "FlowStartTool\Serein.FlowStartTool.csproj", "{38D0FA92-5139-4616-A41E-8186AA4C1532}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.FlowStartTool", "FlowStartTool\Serein.FlowStartTool.csproj", "{38D0FA92-5139-4616-A41E-8186AA4C1532}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.Library.NodeGenerator", "Serein.Library.MyGenerator\Serein.Library.NodeGenerator.csproj", "{5F7DE0B2-A5D3-492D-AC6C-F0C39EBEF365}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serein.Library.NodeGenerator", "Serein.Library.MyGenerator\Serein.Library.NodeGenerator.csproj", "{5F7DE0B2-A5D3-492D-AC6C-F0C39EBEF365}"
|
||||||
@@ -52,10 +50,6 @@ Global
|
|||||||
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
{5E19D0F2-913A-4D1C-A6F8-1E1227BAA0E3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{E40EE629-1A38-4011-88E3-9AD036869987}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{E40EE629-1A38-4011-88E3-9AD036869987}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{E40EE629-1A38-4011-88E3-9AD036869987}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{E40EE629-1A38-4011-88E3-9AD036869987}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{38D0FA92-5139-4616-A41E-8186AA4C1532}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
|
|
||||||
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
<ProjectReference Include="..\Library\Serein.Library.csproj" />
|
||||||
<ProjectReference Include="..\NodeFlow\Serein.NodeFlow.csproj" />
|
<ProjectReference Include="..\NodeFlow\Serein.NodeFlow.csproj" />
|
||||||
|
<ProjectReference Include="..\Serein.Extend.NewtonsoftJson\Serein.Extend.NewtonsoftJson.csproj" />
|
||||||
<ProjectReference Include="..\Serein.Script\Serein.Script.csproj" />
|
<ProjectReference Include="..\Serein.Script\Serein.Script.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Serein.Extend.NewtonsoftJson;
|
||||||
using Serein.Library.Api;
|
using Serein.Library.Api;
|
||||||
using Serein.Library.Utils;
|
using Serein.Library.Utils;
|
||||||
using Serein.NodeFlow.Env;
|
using Serein.NodeFlow.Env;
|
||||||
@@ -54,6 +55,7 @@ namespace Serein.Workbench
|
|||||||
public static void AddFlowServices(this IServiceCollection collection)
|
public static void AddFlowServices(this IServiceCollection collection)
|
||||||
{
|
{
|
||||||
#region 创建实例
|
#region 创建实例
|
||||||
|
JsonHelper.UseJsonProvider(new NewtonsoftJsonProvider());
|
||||||
Func<SynchronizationContext>? getSyncContext = null;
|
Func<SynchronizationContext>? getSyncContext = null;
|
||||||
Dispatcher.CurrentDispatcher.Invoke(() =>
|
Dispatcher.CurrentDispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace Serein.Workbench.ViewModels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开启远程服务
|
/// 开启远程服务
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public ICommand OpenRemoteServerCommand { get; private set; }
|
public ICommand ConvertCodeCommand { get; private set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ namespace Serein.Workbench.ViewModels
|
|||||||
OpenEnvOutWindowCommand = new RelayCommand(OpenEnvOutWindow); // 打开运行输出窗口
|
OpenEnvOutWindowCommand = new RelayCommand(OpenEnvOutWindow); // 打开运行输出窗口
|
||||||
OpenDynamicCompilerCommand = new RelayCommand(OpenDynamicCompiler); // 打开动态编译窗口
|
OpenDynamicCompilerCommand = new RelayCommand(OpenDynamicCompiler); // 打开动态编译窗口
|
||||||
|
|
||||||
OpenRemoteServerCommand = new RelayCommand(OpenRemoteServer); // 打开动态编译窗口
|
ConvertCodeCommand = new RelayCommand(ConvertCode); // 流程图转c#代码
|
||||||
this.flowProjectService = flowProjectService;
|
this.flowProjectService = flowProjectService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,15 +130,13 @@ namespace Serein.Workbench.ViewModels
|
|||||||
private void OpenDynamicCompiler() { }
|
private void OpenDynamicCompiler() { }
|
||||||
private void OpenEnvOutWindow() => LogWindow.Instance?.Show();
|
private void OpenEnvOutWindow() => LogWindow.Instance?.Show();
|
||||||
|
|
||||||
private void OpenRemoteServer()
|
private void ConvertCode()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var env = App.GetService<IFlowEnvironment>();
|
var env = App.GetService<IFlowEnvironment>();
|
||||||
var service = env.IOC.Get<FlowCoreGenerateService>();
|
var service = env.IOC.Get<FlowCoreGenerateService>();
|
||||||
var text = service.ToCsharpCoreFile(); ;
|
var text = service.ToCsharpCoreFile();
|
||||||
Debug.WriteLine(text);
|
Debug.WriteLine(text);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -146,7 +144,6 @@ namespace Serein.Workbench.ViewModels
|
|||||||
{
|
{
|
||||||
Debug.WriteLine(ex.Message);
|
Debug.WriteLine(ex.Message);
|
||||||
}
|
}
|
||||||
//flowEnvironment.StartRemoteServerAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,8 @@
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem Header="拓展">
|
<MenuItem Header="拓展">
|
||||||
<!--<MenuItem Header="动态编译" ></MenuItem>-->
|
<!--<MenuItem Header="动态编译" ></MenuItem>-->
|
||||||
<MenuItem Header="启动远程服务" Command="{Binding OpenRemoteServerCommand}"></MenuItem>
|
<!--<MenuItem Header="流程图转C#代码" Command="{Binding OpenRemoteServerCommand}"></MenuItem>-->
|
||||||
|
<MenuItem Header="流程图转C#代码" Command="{Binding ConvertCodeCommand}"></MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user