Merge branch 'net6' into net462

This commit is contained in:
doudou0720
2026-05-01 23:15:07 +08:00
228 changed files with 23683 additions and 26236 deletions
+19
View File
@@ -0,0 +1,19 @@
namespace Ink_Canvas.Plugins
{
public interface IAppRestartService
{
bool IsRunningAsAdmin { get; }
void RestartApp(bool asAdmin);
void RestartWithCurrentPrivileges();
void RestartAsAdmin();
void RestartAsNormal();
void SwitchToUIATopMostAndRestart();
void SwitchToNormalTopMostAndRestart();
}
}
+11
View File
@@ -0,0 +1,11 @@
using System.Threading.Tasks;
namespace Ink_Canvas.Plugins
{
public interface IInkCanvasService
{
void OpenWhiteboard();
void CloseWhiteboard();
Task OpenWhiteboardAsync(int delayMilliseconds = 0);
}
}
+17
View File
@@ -0,0 +1,17 @@
namespace Ink_Canvas.Plugins
{
public interface IPlugin
{
string Id { get; }
string Name { get; }
string Version { get; }
string Description { get; }
string Author { get; }
int Order { get; }
void Initialize(IPluginHost host);
void Shutdown();
object GetMainView();
object GetSettingsView();
}
}
+12
View File
@@ -0,0 +1,12 @@
using System;
namespace Ink_Canvas.Plugins
{
public interface IPluginHost
{
void Log(string message);
void LogError(string message, Exception ex = null);
T GetService<T>() where T : class;
void RegisterService<T>(T service) where T : class;
}
}
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<UseWPF>true</UseWPF>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>disable</Nullable>
<RootNamespace>Ink_Canvas.Plugins</RootNamespace>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
</Project>
+60
View File
@@ -0,0 +1,60 @@
using System;
namespace Ink_Canvas.Plugins
{
public abstract class PluginBase : IPlugin
{
protected IPluginHost Host { get; private set; }
public abstract string Id { get; }
public abstract string Name { get; }
public abstract string Version { get; }
public abstract string Description { get; }
public abstract string Author { get; }
public abstract int Order { get; }
public virtual void Initialize(IPluginHost host)
{
Host = host;
}
public virtual void Shutdown()
{
}
public virtual object GetMainView()
{
return null;
}
public virtual object GetSettingsView()
{
return null;
}
protected void Log(string message)
{
if (Host != null)
{
Host.Log(message);
}
}
protected void LogError(string message, Exception ex = null)
{
if (Host != null)
{
Host.LogError(message, ex);
}
}
protected T GetService<T>() where T : class
{
if (Host != null)
{
return Host.GetService<T>();
}
return null;
}
}
}
+14
View File
@@ -0,0 +1,14 @@
namespace Ink_Canvas.Plugins
{
public class PluginInfo
{
public string Id { get; set; }
public string Name { get; set; }
public string Version { get; set; }
public string Description { get; set; }
public string Author { get; set; }
public int Order { get; set; }
public IPlugin Instance { get; set; }
public bool IsLoaded { get; set; }
}
}