mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
21 lines
659 B
C#
21 lines
659 B
C#
|
|
namespace LanMountainDesktop.PluginSdk;
|
||
|
|
|
||
|
|
public sealed record PluginLoadResult(
|
||
|
|
string SourcePath,
|
||
|
|
PluginManifest? Manifest,
|
||
|
|
LoadedPlugin? LoadedPlugin,
|
||
|
|
Exception? Error)
|
||
|
|
{
|
||
|
|
public bool IsSuccess => LoadedPlugin is not null && Error is null;
|
||
|
|
|
||
|
|
public static PluginLoadResult Success(string sourcePath, PluginManifest manifest, LoadedPlugin loadedPlugin)
|
||
|
|
{
|
||
|
|
return new PluginLoadResult(sourcePath, manifest, loadedPlugin, null);
|
||
|
|
}
|
||
|
|
|
||
|
|
public static PluginLoadResult Failure(string sourcePath, PluginManifest? manifest, Exception error)
|
||
|
|
{
|
||
|
|
return new PluginLoadResult(sourcePath, manifest, null, error);
|
||
|
|
}
|
||
|
|
}
|