diff --git a/ExamplePlugins.sln b/ExamplePlugins.sln new file mode 100644 index 0000000..48346a7 --- /dev/null +++ b/ExamplePlugins.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.34607.79 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorldPlugin", "HelloWorldPlugin\HelloWorldPlugin.csproj", "{8CC8827D-2BAB-4436-8084-7A8A6208A574}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8CC8827D-2BAB-4436-8084-7A8A6208A574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8CC8827D-2BAB-4436-8084-7A8A6208A574}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8CC8827D-2BAB-4436-8084-7A8A6208A574}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8CC8827D-2BAB-4436-8084-7A8A6208A574}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {83776D0E-FC3A-485E-8A00-E719B1639D72} + EndGlobalSection +EndGlobal diff --git a/HelloWorldPlugin/HelloWorldPlugin.csproj b/HelloWorldPlugin/HelloWorldPlugin.csproj new file mode 100644 index 0000000..d39a903 --- /dev/null +++ b/HelloWorldPlugin/HelloWorldPlugin.csproj @@ -0,0 +1,25 @@ + + + + net8.0-windows + enable + true + enable + True + x64 + + + + + runtime + + + + + + + PreserveNewest + + + + diff --git a/HelloWorldPlugin/Plugin.cs b/HelloWorldPlugin/Plugin.cs new file mode 100644 index 0000000..c4e374f --- /dev/null +++ b/HelloWorldPlugin/Plugin.cs @@ -0,0 +1,20 @@ +using ClassIsland.Core.Abstractions; +using ClassIsland.Core.Attributes; +using ClassIsland.Core.Controls.CommonDialog; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace HelloWorldPlugin; + +[PluginEntrance] +public class Plugin : PluginBase +{ + public override void Initialize(HostBuilderContext context, IServiceCollection services) + { + CommonDialog.ShowInfo("Hello world!"); + } + + public override void OnShutdown() + { + } +} \ No newline at end of file diff --git a/HelloWorldPlugin/Properties/launchSettings.json b/HelloWorldPlugin/Properties/launchSettings.json new file mode 100644 index 0000000..b0b7c83 --- /dev/null +++ b/HelloWorldPlugin/Properties/launchSettings.json @@ -0,0 +1,13 @@ +{ + "profiles": { + "HelloWorldPlugin": { + "commandName": "Project" + }, + "配置文件 1": { + "commandName": "Executable", + "executablePath": "E:\\Coding\\ClassIsland\\ClassIsland\\bin\\Debug\\net8.0-windows\\ClassIsland.exe", + "commandLineArgs": "-epp E:\\Coding\\ExamplePlugins\\HelloWorldPlugin\\bin\\Debug\\net8.0-windows", + "workingDirectory": "E:\\Coding\\ClassIsland\\ClassIsland\\bin\\Debug\\net8.0-windows\\" + } + } +} \ No newline at end of file diff --git a/HelloWorldPlugin/manifest.yml b/HelloWorldPlugin/manifest.yml new file mode 100644 index 0000000..a9a28c9 --- /dev/null +++ b/HelloWorldPlugin/manifest.yml @@ -0,0 +1,5 @@ +id: examples.helloworld +name: Hello world! +description: 在启动时弹出一个 “Hello world” 提示框。 +entranceAssembly: "HelloWorldPlugin.dll" +url: https://github.com/ClassIsland/ExamplePlugins