setting_re3

This commit is contained in:
lincube
2026-03-13 09:10:00 +08:00
parent c4df243610
commit 3b3f060f33
70 changed files with 1986 additions and 8966 deletions

View File

@@ -10,7 +10,8 @@ public sealed class PluginDesktopComponentContext
IReadOnlyDictionary<string, object?> properties,
string componentId,
string? placementId,
double cellSize)
double cellSize,
IPluginSettingsService? pluginSettings = null)
{
ArgumentNullException.ThrowIfNull(manifest);
ArgumentException.ThrowIfNullOrWhiteSpace(pluginDirectory);
@@ -27,6 +28,7 @@ public sealed class PluginDesktopComponentContext
ComponentId = componentId.Trim();
PlacementId = string.IsNullOrWhiteSpace(placementId) ? null : placementId.Trim();
CellSize = Math.Max(1, cellSize);
PluginSettings = pluginSettings;
}
public PluginManifest Manifest { get; }
@@ -45,6 +47,8 @@ public sealed class PluginDesktopComponentContext
public double CellSize { get; }
public IPluginSettingsService? PluginSettings { get; }
public T? GetService<T>()
{
return (T?)Services.GetService(typeof(T));