Files
ScadaBridge/src/ZB.MOM.WW.ScadaBridge.DelmiaNotifier/Reporter.cs
T
Joseph Doherty 5a878b78d4 docs(xml): fill missing XML doc comments + strip task-tracking refs across src (fixdocs)
Add missing <summary>/<param>/<returns>/<typeparam> tags and switch
interface implementations to <inheritdoc/> across 106 files; strip
project bookkeeping identifiers (Task NN, #05-TNN, PLAN-04, StoreAndForward-0NN)
from shipped code comments while preserving the descriptive rationale.
Comment-only: zero code-logic lines changed; solution builds 0/0.

Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
2026-07-10 08:23:56 -04:00

28 lines
1.1 KiB
C#

namespace ZB.MOM.WW.ScadaBridge.DelmiaNotifier;
/// <summary>
/// Maps an outcome to the legacy WWNotifier stdout contract: <c>YES</c> + exit 0 on success,
/// <c>NO</c> followed by a reason line + exit -1 on failure. The writer is injected so stdout is the
/// only thing Delmia ever parses (LF-terminated, deterministic across platforms).
/// </summary>
internal static class Reporter
{
/// <summary>Writes the legacy WWNotifier stdout contract for the given outcome.</summary>
/// <param name="ok">Whether the operation succeeded.</param>
/// <param name="reason">The failure reason to write when <paramref name="ok"/> is <c>false</c>; ignored on success.</param>
/// <param name="stdout">The writer to which the contract output is written.</param>
/// <returns>0 on success; -1 on failure.</returns>
public static int Report(bool ok, string reason, TextWriter stdout)
{
if (ok)
{
stdout.Write("YES\n");
return 0;
}
stdout.Write("NO\n");
stdout.Write(reason);
return -1;
}
}