Builder
이 콘텐츠는 아직 번역되지 않았습니다.
Namespace NetWiv · Assembly NetWiv.Core
public sealed class BuilderConstructors
Section titled “Constructors”Builder
Section titled “Builder”public Builder();Methods
Section titled “Methods”AppCommandManifest
Section titled “AppCommandManifest”public Builder AppCommandManifest(params string[] commands);public App Build();Capability
Section titled “Capability”public Builder Capability(Capability capability);DefaultWindowIcon
Section titled “DefaultWindowIcon”public Builder DefaultWindowIcon(ImageData icon);DevelopmentOrigin
Section titled “DevelopmentOrigin”public Builder DevelopmentOrigin(string origin);InvokeHandler
Section titled “InvokeHandler”public Builder InvokeHandler(Action<CommandRegistry> registration);public Builder InvokeHandler(params string[] generatedCommandNames);Manage
Section titled “Manage”public Builder Manage<T>(T state);Metadata
Section titled “Metadata”public Builder Metadata(AppMetadata metadata);OnMenuEvent
Section titled “OnMenuEvent”public Builder OnMenuEvent(Action<AppHandle, MenuEvent> handler);OnTrayIconEvent
Section titled “OnTrayIconEvent”public Builder OnTrayIconEvent(Action<AppHandle, TrayIconEvent> handler);Permission
Section titled “Permission”public Builder Permission(PermissionDefinition permission);Plugin
Section titled “Plugin”public Builder Plugin(IPlugin plugin);RegisterAsynchronousUriSchemeProtocol
Section titled “RegisterAsynchronousUriSchemeProtocol”public Builder RegisterAsynchronousUriSchemeProtocol(string uriScheme, Func<UriSchemeContext, AssetRequest, Task<AssetResponse>> handler);RegisterCommand
Section titled “RegisterCommand”public Builder RegisterCommand(string name, CommandHandler handler);RegisterGeneratedCommands
Section titled “RegisterGeneratedCommands”public Builder RegisterGeneratedCommands();RegisterUriSchemeProtocol
Section titled “RegisterUriSchemeProtocol”public Builder RegisterUriSchemeProtocol(string uriScheme, Func<UriSchemeContext, AssetRequest, AssetResponse> handler);ResolveAssets
Section titled “ResolveAssets”public Builder ResolveAssets(Func<AssetRequest, AssetResponse> resolver);public void Run();public Builder Setup(Action<App> setup);UseEmbeddedAssets
Section titled “UseEmbeddedAssets”public Builder UseEmbeddedAssets(Assembly assembly = null, string resourcePrefix = "netwiv.assets.");UseEmbeddedConfig
Section titled “UseEmbeddedConfig”public Builder UseEmbeddedConfig(EmbeddedConfigMode mode = 0, Assembly assembly = null, string resourceName = "netwiv.config.json");UseLoggerFactory
Section titled “UseLoggerFactory”public Builder UseLoggerFactory(ILoggerFactory loggerFactory);Supplies the logger factory for NetWiv diagnostics. Defaults to the provider’s factory, then to a no-op factory.
UseRuntime
Section titled “UseRuntime”public Builder UseRuntime(IDesktopRuntime runtime);public Builder UseRuntime(Func<IServiceProvider, IDesktopRuntime> factory);Creates the runtime at build time using the configured root service provider.
The factory must not resolve AppHandle, which is available only after construction completes.
UseServiceProvider
Section titled “UseServiceProvider”public Builder UseServiceProvider(IServiceProvider services);Supplies the root service provider for instance command receivers and [FromServices] command parameters. Each command invocation runs in its own scope when the provider supports scopes. The caller keeps ownership of the provider and disposes it after the app.
Window
Section titled “Window”public Builder Window(WindowOptions options);public Builder Window(string label, string title, string url, double width = 800, double height = 600, JsonElement extraConfig = null);