콘텐츠로 이동

Builder

이 콘텐츠는 아직 번역되지 않았습니다.

Namespace NetWiv · Assembly NetWiv.Core

public sealed class Builder
public Builder();
public Builder AppCommandManifest(params string[] commands);
public App Build();
public Builder Capability(Capability capability);
public Builder DefaultWindowIcon(ImageData icon);
public Builder DevelopmentOrigin(string origin);
public Builder InvokeHandler(Action<CommandRegistry> registration);
public Builder InvokeHandler(params string[] generatedCommandNames);
public Builder Manage<T>(T state);
public Builder Metadata(AppMetadata metadata);
public Builder OnMenuEvent(Action<AppHandle, MenuEvent> handler);
public Builder OnTrayIconEvent(Action<AppHandle, TrayIconEvent> handler);
public Builder Permission(PermissionDefinition permission);
public Builder Plugin(IPlugin plugin);
public Builder RegisterAsynchronousUriSchemeProtocol(string uriScheme, Func<UriSchemeContext, AssetRequest, Task<AssetResponse>> handler);
public Builder RegisterCommand(string name, CommandHandler handler);
public Builder RegisterGeneratedCommands();
public Builder RegisterUriSchemeProtocol(string uriScheme, Func<UriSchemeContext, AssetRequest, AssetResponse> handler);
public Builder ResolveAssets(Func<AssetRequest, AssetResponse> resolver);
public void Run();
public Builder Setup(Action<App> setup);
public Builder UseEmbeddedAssets(Assembly assembly = null, string resourcePrefix = "netwiv.assets.");
public Builder UseEmbeddedConfig(EmbeddedConfigMode mode = 0, Assembly assembly = null, string resourceName = "netwiv.config.json");
public Builder UseLoggerFactory(ILoggerFactory loggerFactory);

Supplies the logger factory for NetWiv diagnostics. Defaults to the provider’s factory, then to a no-op factory.

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.

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.

public Builder Window(WindowOptions options);
public Builder Window(string label, string title, string url, double width = 800, double height = 600, JsonElement extraConfig = null);