From 8f8dd26495d3ce9b2e2cf4a0d12fdb34a8509475 Mon Sep 17 00:00:00 2001 From: Dynesshely Date: Thu, 8 Feb 2024 05:02:22 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=EF=BB=BF=F0=9F=92=BE=20Feat:=20Optimized.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestPlugin.CSharp/Controller.cs | 7 ++++++- TestPlugin.WPF.Core/Controller.cs | 7 ++++++- TestPlugin.Winform.Core/Controller.cs | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/TestPlugin.CSharp/Controller.cs b/TestPlugin.CSharp/Controller.cs index 535d74f..dc5407e 100644 --- a/TestPlugin.CSharp/Controller.cs +++ b/TestPlugin.CSharp/Controller.cs @@ -30,7 +30,7 @@ public void Execute(Command cmd) public List GetFunctions() { - return new(); + return []; } public void SetSendCommandAction(Action action) => sendCommandAction = action; @@ -44,4 +44,9 @@ public void SetWorkPath(string path) { Console.WriteLine($"Work path: {path}"); } + + public void SetCommandsSendBuffer(ref Queue commands) + { + throw new NotImplementedException(); + } } diff --git a/TestPlugin.WPF.Core/Controller.cs b/TestPlugin.WPF.Core/Controller.cs index d5040fb..123029e 100644 --- a/TestPlugin.WPF.Core/Controller.cs +++ b/TestPlugin.WPF.Core/Controller.cs @@ -34,7 +34,7 @@ public List GetFunctions() { return new List() { - new Function() + new() { DisplayNames = new Dictionary() { @@ -78,5 +78,10 @@ public void SetWorkPath(string path) { MessageBox.Show($"SetWorkPath({path})"); } + + public void SetCommandsSendBuffer(ref Queue commands) + { + throw new NotImplementedException(); + } } } diff --git a/TestPlugin.Winform.Core/Controller.cs b/TestPlugin.Winform.Core/Controller.cs index fad2c20..2795369 100644 --- a/TestPlugin.Winform.Core/Controller.cs +++ b/TestPlugin.Winform.Core/Controller.cs @@ -46,4 +46,9 @@ public void SetWorkPath(string path) { Console.WriteLine($"Work path: {path}"); } + + public void SetCommandsSendBuffer(ref Queue commands) + { + throw new NotImplementedException(); + } } From a9a80d28fd341171b68e0d263b5f86c4853e40a9 Mon Sep 17 00:00:00 2001 From: Dynesshely Date: Thu, 8 Feb 2024 17:07:36 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=93=9D=20Chore:=20Optimized.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestPlugin.CSharp/TestPlugin.CSharp.csproj | 2 +- TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TestPlugin.CSharp/TestPlugin.CSharp.csproj b/TestPlugin.CSharp/TestPlugin.CSharp.csproj index 91f85b0..43d1e2d 100644 --- a/TestPlugin.CSharp/TestPlugin.CSharp.csproj +++ b/TestPlugin.CSharp/TestPlugin.CSharp.csproj @@ -19,7 +19,7 @@ - + diff --git a/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj b/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj index ae1738a..d4a284a 100644 --- a/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj +++ b/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj @@ -12,7 +12,7 @@ - + From 0dfdea8c18c6a80947a1b1264c8968cf81ae2f85 Mon Sep 17 00:00:00 2001 From: StarInk Date: Sat, 17 Feb 2024 13:06:35 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A7=20Fix:=20Adapt=20to=20the=20ne?= =?UTF-8?q?w=20architecture.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestPlugin.CSharp/Controller.cs | 3 +- TestPlugin.WPF.Core/Controller.cs | 20 +++++------ TestPlugin.WPF.Core/MainWindow.xaml.cs | 2 +- TestPlugin.WPF.Core/PluginStruct.json | 35 ++++++++++--------- TestPlugin.Winform.Core/Controller.cs | 3 +- .../TestPlugin.Winform.Core.csproj | 2 +- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/TestPlugin.CSharp/Controller.cs b/TestPlugin.CSharp/Controller.cs index dc5407e..4fd54b0 100644 --- a/TestPlugin.CSharp/Controller.cs +++ b/TestPlugin.CSharp/Controller.cs @@ -1,5 +1,6 @@ using KitX.Contract.CSharp; -using KitX.Web.Rules; +using KitX.Shared.Plugin; +using KitX.Shared.WebCommand; using System.Text.Json; namespace TestPlugin.CSharp; diff --git a/TestPlugin.WPF.Core/Controller.cs b/TestPlugin.WPF.Core/Controller.cs index 123029e..6c56d1f 100644 --- a/TestPlugin.WPF.Core/Controller.cs +++ b/TestPlugin.WPF.Core/Controller.cs @@ -1,5 +1,6 @@ using KitX.Contract.CSharp; -using KitX.Web.Rules; +using KitX.Shared.Plugin; +using KitX.Shared.WebCommand; using System; using System.Collections.Generic; using System.Windows; @@ -36,27 +37,26 @@ public List GetFunctions() { new() { + Name = "HelloWorld", DisplayNames = new Dictionary() { { "zh-cn", "你好, 世界!" }, { "en-us", "Hello, World!" } }, - Parameters = new Dictionary>() + Parameters = new List() { + new () { - "par1", - new Dictionary() + Name = "par1", + DisplayNames = new Dictionary() { { "zh-cn", "参数1" }, { "en-us", "Parameter1" } - } + }, + Type = "string", + IsAppendable = false } }, - ParametersType = new List() - { - "void" - }, - HasAppendParameters = false, ReturnValueType = "void" } }; diff --git a/TestPlugin.WPF.Core/MainWindow.xaml.cs b/TestPlugin.WPF.Core/MainWindow.xaml.cs index c00539e..24d75d7 100644 --- a/TestPlugin.WPF.Core/MainWindow.xaml.cs +++ b/TestPlugin.WPF.Core/MainWindow.xaml.cs @@ -1,5 +1,5 @@ using KitX.Contract.CSharp; -using KitX.Web.Rules; +using KitX.Shared.WebCommand; using System; using System.Collections.Generic; using System.Windows; diff --git a/TestPlugin.WPF.Core/PluginStruct.json b/TestPlugin.WPF.Core/PluginStruct.json index 92e1039..1b1c4ef 100644 --- a/TestPlugin.WPF.Core/PluginStruct.json +++ b/TestPlugin.WPF.Core/PluginStruct.json @@ -29,22 +29,23 @@ "tagTest": "test" }, "Functions": [{ - "Name": "print", - "DisplayNames": { - "zh-cn": "打印字符串", - "en-us": "PrintString" - }, - "Parameters": { - "ParameterName": { - "zh-cn": "字符串", - "en-us": "String" - } - }, - "ParametersType": [ - "string" - ], - "HasAppendParameters": false, - "ReturnValueType": "void" - }], + "Name": "HelloWorld", + "DisplayNames": { + "zh-cn": "你好, 世界!", + "en-us": "Hello, World!" + }, + "Parameters": [ + { + "Name": "par1", + "DisplayNames": { + "zh-cn": "参数1", + "en-us": "Parameter1" + }, + "Type": "string", + "IsAppendable": false + } + ], + "ReturnValueType": "void" + }], "RootStartupFileName": "TestPlugin.WPF.Core.dll" } \ No newline at end of file diff --git a/TestPlugin.Winform.Core/Controller.cs b/TestPlugin.Winform.Core/Controller.cs index 2795369..c4348b7 100644 --- a/TestPlugin.Winform.Core/Controller.cs +++ b/TestPlugin.Winform.Core/Controller.cs @@ -1,5 +1,6 @@ using KitX.Contract.CSharp; -using KitX.Web.Rules; +using KitX.Shared.Plugin; +using KitX.Shared.WebCommand; using System.Text.Json; namespace TestPlugin.Winform.Core; diff --git a/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj b/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj index bf22df0..6c520bc 100644 --- a/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj +++ b/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj @@ -13,7 +13,7 @@ - + \ No newline at end of file From 2228f5ecd6d661d5052290319f5e01e55ee8c74f Mon Sep 17 00:00:00 2001 From: Dynesshely Date: Wed, 21 Feb 2024 05:22:50 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=92=BE=20Feat(SDK,=20Standard):=20Ada?= =?UTF-8?q?pt=20`Loader.CSharp`=20and=20`TestPlugin.WPF.Core`=20to=20lates?= =?UTF-8?q?t=20Contract.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestPlugin.CSharp/TestPlugin.CSharp.csproj | 2 +- TestPlugin.WPF.Core/Assets/Descr/zh-cn.md | 2 - TestPlugin.WPF.Core/Controller.cs | 96 ++------ TestPlugin.WPF.Core/MainWindow.xaml | 16 +- TestPlugin.WPF.Core/MainWindow.xaml.cs | 230 +++++++----------- TestPlugin.WPF.Core/PluginStruct.json | 78 +++--- .../TestPlugin.WPF.Core.csproj | 6 +- .../TestPlugin.Winform.Core.csproj | 4 +- 8 files changed, 172 insertions(+), 262 deletions(-) delete mode 100644 TestPlugin.WPF.Core/Assets/Descr/zh-cn.md diff --git a/TestPlugin.CSharp/TestPlugin.CSharp.csproj b/TestPlugin.CSharp/TestPlugin.CSharp.csproj index 43d1e2d..a533f98 100644 --- a/TestPlugin.CSharp/TestPlugin.CSharp.csproj +++ b/TestPlugin.CSharp/TestPlugin.CSharp.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net8.0 enable enable Preview diff --git a/TestPlugin.WPF.Core/Assets/Descr/zh-cn.md b/TestPlugin.WPF.Core/Assets/Descr/zh-cn.md deleted file mode 100644 index 4f4e536..0000000 --- a/TestPlugin.WPF.Core/Assets/Descr/zh-cn.md +++ /dev/null @@ -1,2 +0,0 @@ -# Markdown File - diff --git a/TestPlugin.WPF.Core/Controller.cs b/TestPlugin.WPF.Core/Controller.cs index 6c56d1f..40aaa1f 100644 --- a/TestPlugin.WPF.Core/Controller.cs +++ b/TestPlugin.WPF.Core/Controller.cs @@ -1,87 +1,37 @@ using KitX.Contract.CSharp; -using KitX.Shared.Plugin; using KitX.Shared.WebCommand; +using KitX.Shared.WebCommand.Details; using System; -using System.Collections.Generic; -using System.Windows; -namespace TestPlugin.WPF.Core -{ - public class Controller : IController - { - private readonly MainWindow mainwin; - - public Controller(MainWindow mainwin) - { - this.mainwin = mainwin; - } - - public void End() - { - mainwin.Close(); - } +namespace TestPlugin.WPF.Core; - public void Pause() - { - mainwin.Hide(); - } +public class Controller(MainWindow mainwin) : IController +{ + private readonly MainWindow mainwin = mainwin; - public void Start() - { - mainwin.Show(); - } + public PluginWorkingDetail? WorkingDetail { get; set; } - public List GetFunctions() - { - return new List() - { - new() - { - Name = "HelloWorld", - DisplayNames = new Dictionary() - { - { "zh-cn", "你好, 世界!" }, - { "en-us", "Hello, World!" } - }, - Parameters = new List() - { - new () - { - Name = "par1", - DisplayNames = new Dictionary() - { - { "zh-cn", "参数1" }, - { "en-us", "Parameter1" } - }, - Type = "string", - IsAppendable = false - } - }, - ReturnValueType = "void" - } - }; - } + public void End() + { + mainwin.Close(); + } - public void Execute(Command command) - { + public void Pause() + { + mainwin.Hide(); + } - } + public void Start() + { + mainwin.Show(); + } - public void SetRootPath(string path) - { - MessageBox.Show($"SetRootPath({path})"); - } + public void Execute(Command command) + { - public void SetSendCommandAction(Action action) => mainwin.sendCommandAction = action; + } - public void SetWorkPath(string path) - { - MessageBox.Show($"SetWorkPath({path})"); - } + public void SetWorkingDetail(PluginWorkingDetail workingDetail) => WorkingDetail = workingDetail; - public void SetCommandsSendBuffer(ref Queue commands) - { - throw new NotImplementedException(); - } - } + public void SetSendCommandAction(Action action) => mainwin.sendCommandAction = action; } diff --git a/TestPlugin.WPF.Core/MainWindow.xaml b/TestPlugin.WPF.Core/MainWindow.xaml index 2b270d0..ba2d5d7 100644 --- a/TestPlugin.WPF.Core/MainWindow.xaml +++ b/TestPlugin.WPF.Core/MainWindow.xaml @@ -2,12 +2,18 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:TestPlugin.WPF.Core" - mc:Ignorable="d" SizeToContent="WidthAndHeight" - Title="TestPlugin.WPF.Core - MainWindow" Background="#FF3873D9"> + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + Title="TestPlugin.WPF.Core - MainWindow" + Background="#FF3873D9" + SizeToContent="WidthAndHeight" + mc:Ignorable="d"> - + diff --git a/TestPlugin.WPF.Core/MainWindow.xaml.cs b/TestPlugin.WPF.Core/MainWindow.xaml.cs index 24d75d7..1f34eaa 100644 --- a/TestPlugin.WPF.Core/MainWindow.xaml.cs +++ b/TestPlugin.WPF.Core/MainWindow.xaml.cs @@ -1,156 +1,112 @@ using KitX.Contract.CSharp; +using KitX.Shared.Plugin; using KitX.Shared.WebCommand; using System; -using System.Collections.Generic; +using System.Reflection; using System.Windows; -#pragma warning disable CS8603 // 可能返回 null 引用。 +namespace TestPlugin.WPF.Core; -namespace TestPlugin.WPF.Core +public partial class MainWindow : Window, IIdentityInterface { - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window, IIdentityInterface - { - private readonly Controller controller; - - internal Action? sendCommandAction; + private readonly Controller controller; - public MainWindow() - { - InitializeComponent(); - controller = new(this); + internal Action? sendCommandAction; - Closed += (_, _) => Environment.Exit(0); - } + public MainWindow() + { + InitializeComponent(); - /// - /// 获取插件名称 - /// - /// 插件名称 - public string GetName() => "插件名称"; + controller = new(this); - /// - /// 获取插件版本 - /// - /// 插件版本 - public string GetVersion() => "插件版本"; + Closed += (_, _) => Environment.Exit(0); + } - /// - /// 获取显示名称 - /// - /// 显示名称 - public Dictionary GetDisplayName() => new() + public PluginInfo GetPluginInfo() => new() + { + Name = "TestPlugin.WPF.Core", + DisplayName = new() { - { "zh-cn", "显示名称" }, - { "zh-cnt", "顯示名稱" }, - { "en-us", "Display Name" }, - { "ja-jp", "番組名" } - }; - - /// - /// 获取作者名称 - /// - /// 作者名称 - public string GetAuthorName() => "作者名称"; - - /// - /// 获取发行者名称 - /// - /// 发行者名称 - public string GetPublisherName() => "发行者名称"; - - /// - /// 获取作者链接 - /// - /// 作者链接 - public string GetAuthorLink() => "作者链接"; - - /// - /// 获取发行者链接 - /// - /// 发行者链接 - public string GetPublisherLink() => "发行者链接"; - - /// - /// 获取简单描述 - /// - /// 简单描述 - public Dictionary GetSimpleDescription() => new() + { "zh-cn", "TestPlugin.WPF.Core" }, + { "en-us", "TestPlugin.WPF.Core" }, + }, + Version = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "", + AuthorLink = "https://github.com/Crequency/KitX/", + AuthorName = "Crequency", + PublisherLink = "https://github.com/Crequency/", + PublisherName = "Crequency", + PublishDate = DateTime.Now, + LastUpdateDate = DateTime.Now, + SimpleDescription = new() { - { "zh-cn", "简单描述" }, - { "zh-cnt", "簡單描述" }, - { "en-us", "Simple Description" }, - { "ja-jp", "簡単な説明" } - }; - - /// - /// 获取复杂描述 - /// - /// 复杂描述 - public Dictionary GetComplexDescription() => new() + { "zh-cn", "TestPlugin.WPF.Core" }, + { "en-us", "TestPlugin.WPF.Core" }, + }, + ComplexDescription = new() { - { "zh-cn", "复杂描述" }, - { "zh-cnt", "複雜描述" }, - { "en-us", "Complex Description" }, - { "ja-jp", "複雑な説明" } - }; - - /// - /// 获取 MarkDown 语法的完整介绍 - /// - /// 完整介绍 - public Dictionary GetTotalDescriptionInMarkdown() => new() + { "zh-cn", "用于测试于验证 WPF.Core 框架下的插件可行性" }, + { "en-us", "Used to test and verify the feasibility of plug-ins under the WPF.Core framework" }, + }, + TotalDescriptionInMarkdown = new() { - { "zh-cn", "完整描述" }, - { "zh-cnt", "完整描述" }, - { "en-us", "Total Description" }, - { "ja-jp", "完全な説明" } - }; - - /// - /// 获取 Base64 编码的图标 - /// - /// Base64 编码的图标 - public string GetIconInBase64() => "图标"; - - /// - /// 获取发行日期 - /// - /// 发行日期 - public DateTime GetPublishDate() => DateTime.Now; - - /// - /// 获取最近更新日期 - /// - /// 最近更新日期 - public DateTime GetLastUpdateDate() => DateTime.Now; - - /// - /// 获取控制器 - /// - /// 控制器 - public IController GetController() => controller; - - /// - /// 指示是否是市场版本 - /// - /// 是否是市场版本 - public bool IsMarketVersion() => false; + { + "zh-cn", + """ + # 你好! + ```cpp + void helloWorld(string greet) { + std::cout << "Hello, World!"; + } + ``` + """ + }, + { + "en-us", + """ + # Hi, there! + ```cpp + void helloWorld(string greet) { + std::cout << "Hello, World!"; + } + ``` + """ + }, + }, + IconInBase64 = "", + IsMarketVersion = false, + RootStartupFileName = "TestPlugin.WPF.Core.dll", + Functions = [ + new Function() + { + Name = "HelloKitX", + DisplayNames = new() + { + { "zh-cn", "你好 KitX !" }, + { "en-us", "Hello KitX !" }, + }, + ReturnValueType = "void", + Parameters = [ + new Parameter() + { + Name = "greet", + DisplayNames = new() + { + { "zh-cn", "问候语" }, + { "en-us", "GreetingText" }, + }, + Type = "string", + IsAppendable = false, + } + ], + }, + ], + Tags = new() + { + { "IsTestPlugin", "true" } + }, + }; - /// - /// 获取市场版本插件协议 - /// - /// 市场版本插件协议 - public IMarketPluginContract GetMarketPluginContract() => null; + public IController GetController() => controller; - /// - /// 获取根启动文件名称 - /// - /// 根启动文件名称 - public string GetRootStartupFileName() => "TestPlugin.WPF.Core.dll"; - } + public IMarketPluginContract GetMarketPluginContract() => null!; } - -#pragma warning restore CS8603 // 可能返回 null 引用。 diff --git a/TestPlugin.WPF.Core/PluginStruct.json b/TestPlugin.WPF.Core/PluginStruct.json index 1b1c4ef..9e92de2 100644 --- a/TestPlugin.WPF.Core/PluginStruct.json +++ b/TestPlugin.WPF.Core/PluginStruct.json @@ -1,51 +1,53 @@ -{ +{ "Name": "TestPlugin.WPF.Core", - "Version": "v1.0.0", "DisplayName": { - "zh-cn": "WPF.Core 测试插件", + "zh-cn": "TestPlugin.WPF.Core", "en-us": "TestPlugin.WPF.Core" }, - "AuthorName": "Dynesshely", + "Version": "1.0.0.307", + "AuthorLink": "https://github.com/Crequency/KitX/", + "AuthorName": "Crequency", + "PublisherLink": "https://github.com/Crequency/", "PublisherName": "Crequency", - "AuthorLink": "https://blog.catrol.cn", - "PublisherLink": "https://www.catrol.cn", + "PublishDate": "2024-02-20T23:40:00.5475765+08:00", + "LastUpdateDate": "2024-02-20T23:40:00.5475782+08:00", "SimpleDescription": { - "zh-cn": "用于测试于验证 WPF.Core 框架下的插件可行性", - "en-us": "Used to test and verify the feasibility of plug-ins under the WPF.Core framework" + "zh-cn": "TestPlugin.WPF.Core", + "en-us": "TestPlugin.WPF.Core" }, "ComplexDescription": { - "zh-cn": "\u590D\u6742\u63CF\u8FF0", - "en-us": "ComplexDescription" + "zh-cn": "\u7528\u4E8E\u6D4B\u8BD5\u4E8E\u9A8C\u8BC1 WPF.Core \u6846\u67B6\u4E0B\u7684\u63D2\u4EF6\u53EF\u884C\u6027", + "en-us": "Used to test and verify the feasibility of plug-ins under the WPF.Core framework" }, "TotalDescriptionInMarkdown": { - "zh-cn": "# Hi, there! \r\n ```cpp \r\n void helloWorld() { std::cout << \"Hello, World!\"; } \r\n ```", - "en-us": "# 你好! \r\n ```cpp \r\n void helloWorld() { std::cout << \"Hello, World!\"; } \r\n ```" + "zh-cn": "# \u4F60\u597D!\r\n\u0060\u0060\u0060cpp\r\nvoid helloWorld(string greet) {\r\n std::cout \u003C\u003C \u0022Hello, World!\u0022;\r\n}\r\n\u0060\u0060\u0060", + "en-us": "# Hi, there!\r\n\u0060\u0060\u0060cpp\r\nvoid helloWorld(string greet) {\r\n std::cout \u003C\u003C \u0022Hello, World!\u0022;\r\n}\r\n\u0060\u0060\u0060" }, - "IconInBase64": "Base64 Format Icon", - "PublishDate": "2022-12-03T12:02:24.8238944+08:00", - "LastUpdateDate": "2022-12-03T12:02:24.8261798+08:00", + "IconInBase64": "", "IsMarketVersion": false, + "RootStartupFileName": "TestPlugin.WPF.Core.dll", + "Functions": [ + { + "Name": "HelloKitX", + "DisplayNames": { + "zh-cn": "\u4F60\u597D KitX !", + "en-us": "Hello KitX !" + }, + "ReturnValueType": "void", + "Parameters": [ + { + "Name": "greet", + "DisplayNames": { + "zh-cn": "\u95EE\u5019\u8BED", + "en-us": "GreetingText" + }, + "Type": "string", + "IsAppendable": false + } + ] + } + ], "Tags": { - "tagTest": "test" - }, - "Functions": [{ - "Name": "HelloWorld", - "DisplayNames": { - "zh-cn": "你好, 世界!", - "en-us": "Hello, World!" - }, - "Parameters": [ - { - "Name": "par1", - "DisplayNames": { - "zh-cn": "参数1", - "en-us": "Parameter1" - }, - "Type": "string", - "IsAppendable": false - } - ], - "ReturnValueType": "void" - }], - "RootStartupFileName": "TestPlugin.WPF.Core.dll" -} \ No newline at end of file + "IsTestPlugin": "true" + } +} diff --git a/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj b/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj index d4a284a..3082fad 100644 --- a/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj +++ b/TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj @@ -2,7 +2,7 @@ Library - net7.0-windows + net8.0-windows enable true @@ -13,12 +13,10 @@ + - - Never - Always diff --git a/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj b/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj index 6c520bc..7128591 100644 --- a/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj +++ b/TestPlugin.Winform.Core/TestPlugin.Winform.Core.csproj @@ -2,7 +2,7 @@ WinExe - net7.0-windows + net8.0-windows enable true enable @@ -13,7 +13,7 @@ - + \ No newline at end of file From 02d9b24b32f92ca96a3b9ec0b99e82d444d575d6 Mon Sep 17 00:00:00 2001 From: Dynesshely Date: Sun, 25 Feb 2024 19:10:39 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=92=BE=20Feat:=20The=20first=20time?= =?UTF-8?q?=20that=20dashboard=20invoke=20plugin=20function=20throw=20netw?= =?UTF-8?q?ork=20connection.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TestPlugin.WPF.Core/Controller.cs | 6 +++++- TestPlugin.WPF.Core/MainWindow.xaml.cs | 14 +------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/TestPlugin.WPF.Core/Controller.cs b/TestPlugin.WPF.Core/Controller.cs index 40aaa1f..d4cab33 100644 --- a/TestPlugin.WPF.Core/Controller.cs +++ b/TestPlugin.WPF.Core/Controller.cs @@ -2,6 +2,7 @@ using KitX.Shared.WebCommand; using KitX.Shared.WebCommand.Details; using System; +using System.Windows; namespace TestPlugin.WPF.Core; @@ -28,7 +29,10 @@ public void Start() public void Execute(Command command) { - + if (command.FunctionName.Equals("HelloKitX")) + { + MessageBox.Show("Hello KitX !"); + } } public void SetWorkingDetail(PluginWorkingDetail workingDetail) => WorkingDetail = workingDetail; diff --git a/TestPlugin.WPF.Core/MainWindow.xaml.cs b/TestPlugin.WPF.Core/MainWindow.xaml.cs index 1f34eaa..322eab4 100644 --- a/TestPlugin.WPF.Core/MainWindow.xaml.cs +++ b/TestPlugin.WPF.Core/MainWindow.xaml.cs @@ -85,19 +85,7 @@ void helloWorld(string greet) { { "en-us", "Hello KitX !" }, }, ReturnValueType = "void", - Parameters = [ - new Parameter() - { - Name = "greet", - DisplayNames = new() - { - { "zh-cn", "问候语" }, - { "en-us", "GreetingText" }, - }, - Type = "string", - IsAppendable = false, - } - ], + Parameters = [], }, ], Tags = new()