b86c6bb47f
Resolve all CommentChecker findings across the gateway server, worker, tests, and .NET client (314 -> 0 real issues): add missing <returns>/<summary>/<param> on public and test members, convert Stream/interface overrides to <inheritdoc/>, and remove internal task/issue tracking IDs (SEC-*, IPC-*, WRK-*, GWC-*, TST-*, Client.Dotnet-*) from shipped code documentation while preserving the design rationale prose. Shipped comments should not carry internal bookkeeping, and complete XML docs keep the analyzer/TreatWarningsAsErrors gate and generated API docs clean. The 6 remaining flags are heuristic false positives (MD5, UTC-4, capacity-1, near-1601) left intact so real documentation is not corrupted. Claude-Session: https://claude.ai/code/session_01DMXXvNuPekkkrTEyPNxEkW
33 lines
1.3 KiB
C#
33 lines
1.3 KiB
C#
using ZB.MOM.WW.MxGateway.Contracts.Proto;
|
|
|
|
namespace ZB.MOM.WW.MxGateway.Client;
|
|
|
|
/// <summary>Extension methods for MxStatusProxy values.</summary>
|
|
public static class MxStatusProxyExtensions
|
|
{
|
|
/// <summary>Returns whether the status indicates success (success flag set and category is Ok).</summary>
|
|
/// <param name="status">The status to check.</param>
|
|
/// <returns><see langword="true"/> if the status indicates success; otherwise <see langword="false"/>.</returns>
|
|
public static bool IsSuccess(this MxStatusProxy status)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(status);
|
|
|
|
return status.Success != 0
|
|
&& status.Category is MxStatusCategory.Ok;
|
|
}
|
|
|
|
/// <summary>Returns a formatted summary of the status for diagnostic output.</summary>
|
|
/// <param name="status">The status to summarize.</param>
|
|
/// <returns>A formatted diagnostic summary string.</returns>
|
|
public static string ToDiagnosticSummary(this MxStatusProxy status)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(status);
|
|
|
|
string diagnosticText = string.IsNullOrWhiteSpace(status.DiagnosticText)
|
|
? "no diagnostic text"
|
|
: status.DiagnosticText;
|
|
|
|
return $"{status.Category} by {status.DetectedBy}; detail={status.Detail}; {diagnosticText}";
|
|
}
|
|
}
|