Skip to content

Commit

Permalink
💾 Feat: Attributes for auto info file generation in future
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Apr 21, 2024
1 parent 2c2a210 commit 2fd3d44
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 57 deletions.
2 changes: 1 addition & 1 deletion TestPlugin.WPF.Core/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void Execute(Command command)
{
if (command.FunctionName.Equals("HelloKitX"))
{
MessageBox.Show("Hello KitX !");
Functions.HelloKitX();
}
}

Expand Down
27 changes: 27 additions & 0 deletions TestPlugin.WPF.Core/Functions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Windows;
using KitX.Contract.CSharp.Attributes;

namespace TestPlugin.WPF.Core;

[EntryClass]
public class Functions
{
[Function(nameof(HelloKitX))]
public static void HelloKitX()
{
MessageBox.Show("Hello KitX !");
}

[Function(nameof(HelloAnything))]
[Translation("DisplayName", "zh-CN", "打个招呼")]
[Translation("DisplayName", "en-US", "Hello Anything")]
public static void HelloAnything(
[Parameter(nameof(name))]
[Translation("DisplayName", "zh-CN", "名称")]
[Translation("DisplayName", "en-US", "Name")]
string name
)
{
MessageBox.Show($"Hello {name} !");
}
}
53 changes: 0 additions & 53 deletions TestPlugin.WPF.Core/PluginStruct.json

This file was deleted.

4 changes: 1 addition & 3 deletions TestPlugin.WPF.Core/TestPlugin.WPF.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@

<ItemGroup>
<ProjectReference Include="..\..\..\KitX Standard\KitX Contracts\KitX.Contract.CSharp\KitX.Contract.CSharp.csproj" />
<ProjectReference Include="..\..\Generators\KitX.Sdk.Generators.CSharp\KitX.Sdk.Generators.CSharp.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

<ItemGroup>
<None Update="LoaderStruct.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="PluginStruct.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>

0 comments on commit 2fd3d44

Please sign in to comment.