Bee.UI.Core 4.1.0

dotnet add package Bee.UI.Core --version 4.1.0
                    
NuGet\Install-Package Bee.UI.Core -Version 4.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Bee.UI.Core" Version="4.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bee.UI.Core" Version="4.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Bee.UI.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Bee.UI.Core --version 4.1.0
                    
#r "nuget: Bee.UI.Core, 4.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Bee.UI.Core@4.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Bee.UI.Core&version=4.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Bee.UI.Core&version=4.1.0
                    
Install as a Cake Tool

Bee.UI.Core

繁體中文

NuGet Build CI License: MIT

Client-side bridging layer for Bee.NET UI applications. Bee.UI.Core wraps Bee.Api.Client connectors with a single static entry point (ClientInfo) that manages connection settings, login state, and definition-data access — letting WinForms / WPF / Avalonia hosts focus on views instead of plumbing.

Targets net10.0.

✨ Features

  • One-line bootstrap: ClientInfo.Initialize(...) resolves the saved endpoint, validates it, falls back to a connection setup view when missing, and primes the API connector.
  • Local & remote connection abstraction: Switch between local (file-based define path) and remote (JSON-RPC URL) by changing the endpoint string; the rest of the API surface is unchanged.
  • Connector caching: SystemApiConnector and IDefineAccess are cached per token; resetting the access token automatically invalidates them.
  • Pluggable persistence: Replace the default EndpointStorage (XML-backed <exe>.Settings.xml) with your own IEndpointStorage implementation.
  • Host-supplied UI: Connection-settings dialogs are abstracted behind IUIViewService, leaving the choice of UI framework to the consumer.

📦 Installation

dotnet add package Bee.UI.Core

Or in .csproj:

<PackageReference Include="Bee.UI.Core" Version="4.1.0" />

This package depends on:

Package Version
Bee.Api.Client 4.1.0

(Transitively pulls in Bee.Base, Bee.Definition, Bee.Api.Core, Bee.Api.Contracts.)

🚀 Quick Start

1. Implement the host UI service

IUIViewService is invoked when the saved endpoint is missing or unreachable, prompting the user to configure a new one.

using Bee.UI.Core;

public class MainFormUIViewService : IUIViewService
{
    public bool ShowApiConnect()
    {
        using var dialog = new ApiConnectDialog();
        return dialog.ShowDialog() == DialogResult.OK;
    }
}

2. Initialize on startup

using Bee.UI.Core;
using Bee.Api.Client;

// At application startup:
if (!ClientInfo.Initialize(new MainFormUIViewService(), SupportedConnectTypes.Both))
{
    // User cancelled the connection setup — exit.
    return;
}

Or directly with a known endpoint (no UI fallback):

ClientInfo.Initialize("http://localhost:5000/jsonrpc/api");

3. Apply the login result

After a successful login through SystemApiConnector, hand the response to ClientInfo to populate the access token and user info:

var response = await ClientInfo.SystemApiConnector.LoginAsync(userId, password);
ClientInfo.ApplyLoginResult(response);

4. Use the connectors

// System-level connector (cached per token):
var system = ClientInfo.SystemApiConnector;

// Form-level connector for a specific program:
var employee = ClientInfo.CreateFormApiConnector("Employee");

// Definition data access:
var formSchema = ClientInfo.DefineAccess.GetFormSchema("Employee");

🔧 Customization

Replace the endpoint storage

The default EndpointStorage persists to <ExeName>.Settings.xml next to the executable. To use a different backend (registry, environment variable, in-memory, etc.) supply your own implementation before Initialize:

public class EnvVarEndpointStorage : IEndpointStorage
{
    public string LoadEndpoint() => Environment.GetEnvironmentVariable("API_ENDPOINT") ?? "";
    public void SetEndpoint(string endpoint) { /* ... */ }
    public void SaveEndpoint(string endpoint) => Environment.SetEnvironmentVariable("API_ENDPOINT", endpoint);
}

ClientInfo.EndpointStorage = new EnvVarEndpointStorage();
ClientInfo.Initialize(uiViewService, SupportedConnectTypes.Both);

Override the endpoint via command line

Initialize(IUIViewService, SupportedConnectTypes) parses Key=Value pairs from the command line. Pass Endpoint=... to override the saved endpoint at launch:

MyApp.exe Endpoint=http://staging.example.com/jsonrpc/api

The parsed dictionary is exposed through ClientInfo.Arguments.

🧩 Public API at a glance

Member Purpose
ClientInfo.Initialize(IUIViewService, SupportedConnectTypes) Bootstrap from saved settings with UI fallback
ClientInfo.Initialize(string endpoint) Bootstrap with an explicit endpoint
ClientInfo.SetEndpoint(string) / GetEndpoint() Switch the active endpoint at runtime
ClientInfo.ApplyLoginResult(LoginResponse) Apply the login response (token + user info)
ClientInfo.SystemApiConnector System-level connector (auto-cached)
ClientInfo.CreateFormApiConnector(progId) Form-level connector for a specific program
ClientInfo.DefineAccess Remote definition-data accessor
ClientInfo.UserInfo / AccessToken Authenticated user state
IUIViewService Contract for the host application's view service
IEndpointStorage / EndpointStorage Endpoint persistence contract & default impl
VersionInfo Version / product metadata of the entry assembly

🌐 Bee.NET Ecosystem

Repository Role
bee-library Core framework (Bee.Base, Bee.Definition, Bee.Api.*, Bee.Business, …)
bee-jsonrpc-sample End-to-end JSON-RPC server / client samples
bee-ui-core (this repo) UI-side connection state & connector plumbing

📬 Contact

FacebookHackMDGitHubNuGet

📄 License

MIT © Bee.NET

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Bee.UI.Core:

Package Downloads
Bee.UI.WinForms

UI components and layout management for WinForms.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.0 82 5/6/2026
4.0.1 124 4/10/2026
3.6.2 250 11/7/2025
3.6.1 218 10/28/2025
3.6.0 163 10/24/2025
3.5.2 207 10/15/2025
3.5.1 204 10/5/2025
3.5.0 214 9/25/2025
3.4.9 217 9/25/2025
3.4.8 270 9/24/2025
3.4.7 196 9/23/2025
3.4.6 225 9/22/2025
3.4.5 247 9/22/2025
3.4.4 231 9/22/2025
3.4.3 188 9/21/2025
3.4.2 331 9/18/2025
3.4.1 328 9/16/2025
3.4.0 170 9/5/2025
3.3.1 210 9/4/2025
3.3.0 197 9/3/2025
Loading failed