Archived
248 lines
13 KiB
HTML
248 lines
13 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Namespace Hi.Common.Messages | HiAPI-C# 2025 </title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="title" content="Namespace Hi.Common.Messages | HiAPI-C# 2025 ">
|
|
|
|
|
|
<link rel="icon" href="../img/HiAPI.favicon.ico">
|
|
<link rel="stylesheet" href="../public/docfx.min.css">
|
|
<link rel="stylesheet" href="../public/main.css">
|
|
<meta name="docfx:navrel" content="../toc.html">
|
|
<meta name="docfx:tocrel" content="toc.html">
|
|
|
|
<meta name="docfx:rel" content="../">
|
|
|
|
|
|
|
|
<meta name="loc:inThisArticle" content="In this article">
|
|
<meta name="loc:searchResultsCount" content="{count} results for "{query}"">
|
|
<meta name="loc:searchNoResults" content="No results for "{query}"">
|
|
<meta name="loc:tocFilter" content="Filter by title">
|
|
<meta name="loc:nextArticle" content="Next">
|
|
<meta name="loc:prevArticle" content="Previous">
|
|
<meta name="loc:themeLight" content="Light">
|
|
<meta name="loc:themeDark" content="Dark">
|
|
<meta name="loc:themeAuto" content="Auto">
|
|
<meta name="loc:changeTheme" content="Change theme">
|
|
<meta name="loc:copy" content="Copy">
|
|
<meta name="loc:downloadPdf" content="Download PDF">
|
|
|
|
<script type="module" src="./../public/docfx.min.js"></script>
|
|
|
|
<script>
|
|
const theme = localStorage.getItem('theme') || 'auto'
|
|
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
|
|
<header class="bg-body border-bottom">
|
|
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
|
|
<div class="container-xxl flex-nowrap">
|
|
<a class="navbar-brand" href="../index.html">
|
|
<img id="logo" class="svg" src="../img/HiAPI.logo.png" alt="">
|
|
|
|
</a>
|
|
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
|
|
<i class="bi bi-three-dots"></i>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navpanel">
|
|
<div id="navbar">
|
|
<form class="search" role="search" id="search">
|
|
<i class="bi bi-search"></i>
|
|
<input class="form-control" id="search-query" type="search" disabled placeholder="Search" autocomplete="off" aria-label="Search">
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="container-xxl">
|
|
<div class="toc-offcanvas">
|
|
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
|
|
<div class="offcanvas-header">
|
|
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
|
|
</div>
|
|
<div class="offcanvas-body">
|
|
<nav class="toc" id="toc"></nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content">
|
|
<div class="actionbar">
|
|
<button class="btn btn-lg border-0 d-md-none" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
|
|
<i class="bi bi-list"></i>
|
|
</button>
|
|
|
|
<nav id="breadcrumb"></nav>
|
|
</div>
|
|
|
|
<article data-uid="Hi.Common.Messages">
|
|
|
|
<h1 id="Hi_Common_Messages" data-uid="Hi.Common.Messages" class="text-break">Namespace Hi.Common.Messages</h1>
|
|
<div class="markdown level0 summary"></div>
|
|
<div class="markdown level0 conceptual"></div>
|
|
<div class="markdown level0 remarks"></div>
|
|
|
|
<h3 id="classes">
|
|
Classes
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.ActionProgress-1.html">ActionProgress<T></a></dt>
|
|
<dd><p>Lightweight <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress<T></a> that delegates to an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.action-1">Action<T></a>.
|
|
Unlike <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.progress-1">Progress<T></a>, does not capture
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.synchronizationcontext">SynchronizationContext</a>
|
|
and invokes the handler synchronously on the caller's thread.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.DebugUtil.html">DebugUtil</a></dt>
|
|
<dd><p>Debug utility provides functions: pause process, count execution time and show the count.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.ExceptionUtil.html">ExceptionUtil</a></dt>
|
|
<dd><p>Provides utility methods for handling exceptions.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.MessageBoardUtil.html">MessageBoardUtil</a></dt>
|
|
<dd><p>Utility class for displaying messages on a message board.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.MessageCollector.html">MessageCollector</a></dt>
|
|
<dd><p>A minimal <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress<T></a> of <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> that buffers every
|
|
reported message into <a class="xref" href="Hi.Common.Messages.MessageCollector.html#Hi_Common_Messages_MessageCollector_Messages">Messages</a>. Intended as a per-call / per-request
|
|
sink: a caller injects it into a have-both function (one that takes an
|
|
<code>IProgress<IMessage> messageProgress</code>), runs the operation, then reads the
|
|
collected messages back — e.g. to return them in an HTTP response so a REST / AI
|
|
caller sees progress, success, and error notifications inline.</p>
|
|
<p>Unlike the session / step sinks (<code>ShellProgress</code>, <code>StepDiagnosticProgress</code>) it
|
|
fires no events and holds no session or pipeline state; it is cheap to create and
|
|
discard for the lifetime of a single call.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.MessageUtil.html">MessageUtil</a></dt>
|
|
<dd><p>Extension helpers for reporting <a class="xref" href="Hi.Common.Messages.SimpleMessage.html">SimpleMessage</a> records onto an
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress<T></a> of <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> sink — the <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>-channel
|
|
counterpart of <code>NcDiagnosticProgress</code>'s shorthand methods. Every helper is named
|
|
<code>{Category}{Severity}</code> and is id-first; the structured <code>id</code> is used for
|
|
filtering / suppression. All overloads are null-safe on <code>host</code>.</p>
|
|
<p>
|
|
Each helper has a <code>{Category}{Severity}Fmt</code> sibling taking a
|
|
<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.formattablestring">FormattableString</a>: it keeps the interpolated template and values
|
|
(<a class="xref" href="Hi.Common.Messages.SimpleMessage.html#Hi_Common_Messages_SimpleMessage_Format">Format</a> / <a class="xref" href="Hi.Common.Messages.SimpleMessage.html#Hi_Common_Messages_SimpleMessage_Args">Args</a>) so a client can
|
|
re-render the message in another language, while the notification stays the invariant
|
|
English rendering. The sibling must be opted into by name — an interpolated string literal
|
|
passed to the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> helper binds to <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a> and is not captured.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.SimpleMessage.html">SimpleMessage</a></dt>
|
|
<dd><p>A plain <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> with no anchor: severity, category, id, notification text and
|
|
optional detail. This is the default carrier for ad-hoc messages that have no other home.
|
|
When step context is available, a step-anchored decorator wraps a <a class="xref" href="Hi.Common.Messages.SimpleMessage.html">SimpleMessage</a>
|
|
to add the <code>StepIndex</code> / <code>SentenceCarrier</code> without the producer needing to know it.</p>
|
|
</dd>
|
|
</dl>
|
|
<h3 id="interfaces">
|
|
Interfaces
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a></dt>
|
|
<dd><p>Common contract for a single reportable item on an <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress<T></a>
|
|
channel — an NC diagnostic, a step-anchored notice, a simple message, or a progress
|
|
fraction. Consumers (GUI / log) treat every kind uniformly through this view, while each
|
|
concrete kind is still stored by its own owner (e.g. <code>NcDiagnostic</code> by
|
|
<code>NcDiagnosticProgress</code>, <code>ClStripPos</code> by <code>ClStrip</code>) rather than being mixed
|
|
into one shared collection.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.IProgressMessage.html">IProgressMessage</a></dt>
|
|
<dd><p>Marker for an <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> that is itself a <b>container</b> of messages (a batch
|
|
produced over the course of some scoped work) rather than a single leaf notice. A sink may give
|
|
it special treatment — unrolling its accumulated children, in order, instead of storing the
|
|
composite object itself.</p>
|
|
<p>
|
|
Empty by design: the contract is purely the marker. The children are exposed by the concrete
|
|
type (e.g. <code>StepScopedProgress.MessageList</code>) and drained at the point that owns the
|
|
ordering guarantee, so a consumer that does not recognize <a class="xref" href="Hi.Common.Messages.IProgressMessage.html">IProgressMessage</a> simply
|
|
treats the composite as an opaque <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>.
|
|
</p>
|
|
</dd>
|
|
</dl>
|
|
<h3 id="enums">
|
|
Enums
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.BootstrapTheme.html">BootstrapTheme</a></dt>
|
|
<dd><p>Bootstrap theme colors for UI styling.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.Category.html">Category</a></dt>
|
|
<dd><p>Classification of an <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> — the “what kind of concern” axis, orthogonal to the
|
|
<a class="xref" href="Hi.Common.Messages.Severity.html">Severity</a> importance axis it pairs with. Applies to every <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a> on
|
|
the channel (lifecycle / progress notices, configuration checks, NC-pipeline diagnostics, …),
|
|
not only NC messages.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.MessageFlag.html">MessageFlag</a></dt>
|
|
<dd><p>Enumeration of common message types used for system notifications.</p>
|
|
</dd>
|
|
</dl>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.Severity.html">Severity</a></dt>
|
|
<dd><p>Importance level of an <a class="xref" href="Hi.Common.Messages.IMessage.html">IMessage</a>. Combined with <a class="xref" href="Hi.Common.Messages.Category.html">Category</a> to form
|
|
the full meaning (e.g. <code>Validation + Warning</code>). Promoted from the former
|
|
<code>NcDiagnosticSeverity</code> so non-NC messages (simple notices, progress fractions) share a
|
|
single scale.</p>
|
|
</dd>
|
|
</dl>
|
|
<h3 id="delegates">
|
|
Delegates
|
|
</h3>
|
|
<dl class="jumplist">
|
|
<dt><a class="xref" href="Hi.Common.Messages.ShowMessageBoardDelegate.html">ShowMessageBoardDelegate</a></dt>
|
|
<dd><p>Delegate for showing message board notifications.</p>
|
|
</dd>
|
|
</dl>
|
|
|
|
|
|
</article>
|
|
|
|
<div class="contribution d-print-none">
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="affix">
|
|
<nav id="affix"></nav>
|
|
</div>
|
|
</main>
|
|
|
|
<div class="container-xxl search-results" id="search-results"></div>
|
|
|
|
<footer class="border-top text-secondary">
|
|
<div class="container-xxl">
|
|
<div class="flex-fill">
|
|
<span> Copyright © 2025 <a href='https://superhightech.com.tw'>Tech Coordinate</a>. All rights reserved. <a href='https://superhightech.com.tw'>超級高科技股份有限公司</a> © 2025 版權所有 </span>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
</body>
|
|
</html>
|