Table of Contents

General Rules

This document describes the common patterns and conventions used throughout the HiNC GUI codebase.

Message and Exception Handling

HiNC uses three independent message categories: Diagnostic (IProgress<object>), UI Notification (MessageBoardUtil), and App Log (ILogger). See Message Management for the full design pattern.

For async exception handling, use CatchExceptions with a caller-provided handler:

await task.CatchExceptions(ex => progress?.Report(ex));

The Bottom Message Bar displays UI-level notifications. The Session Message Panel displays session diagnostic messages.

Loose Manner

The Loose Manner pattern handles rapidly-called synchronous actions where only the last call needs to be effective.

The LooseRunner class manages skippable rapid-calling synchronous actions. When an action is called rapidly, only the last call is executed while previous calls are safely skipped. The TryRun method is used to execute actions in this manner.

The LooseRunner should be disposed when its owner is disposed to ensure proper resource cleanup.

GUI File Path Assignment

See GUI File Path Assignment.

Numeric Input/Output Handling

The numeric-utils.js module handles special floating-point values (such as NaN, Infinity) in web forms. See Numeric Input/Output Utilities for details.

Webapi with hub-cleapup assistence pattern

Webapi with hub-cleapup assistence pattern

Loose Couple

If model of the UI component is null or mismatch, apply status badge instead of throwing exception to keep UI work.

Translation Remarks

See Translation Remarks.