Skip to content

Commit dacdc02

Browse files
committed
docs(xml): clarify Get/GetByNamespace docs; annotate InternalsVisibleTo
The XML doc summaries on MTConnectVersion.Get and .GetByNamespace were verbatim copies of each other, obscuring the actual contract: Get takes a raw XML document (delegating to Namespaces.Get for the extraction step), GetByNamespace takes an already-resolved namespace URI. Rewrite each summary to state its own signature and mention the Max-fallback behavior on GetByNamespace. Annotate the InternalsVisibleTo grant in MTConnect.NET-XML.csproj so a future reader sees why the library reaches into MTConnect.NET-XML-Tests (the tests reach the internal MTConnectVersion / Namespaces helpers, which have no public equivalent). Also tighten the trailing newline of MTConnectVersion.cs and update two comment breaks in the test file to tight em-dashes. Ultrareview findings F-SIMP-003, F-CR-002, F-CR-004, F-CR-006 (LOW/NIT).
1 parent d25c20b commit dacdc02

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

libraries/MTConnect.NET-XML/MTConnect.NET-XML.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
</ItemGroup>
7474

7575
<ItemGroup>
76+
<!-- Grants MTConnect.NET-XML-Tests reach into the internal helpers (MTConnectVersion, Namespaces) that have no public equivalent. The assembly is not strong-named, so no PublicKey clause is required. -->
7677
<InternalsVisibleTo Include="MTConnect.NET-XML-Tests" />
7778
</ItemGroup>
7879

libraries/MTConnect.NET-XML/MTConnectVersion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace MTConnect
88
internal static class MTConnectVersion
99
{
1010
/// <summary>
11-
/// Gets the Version of the MTConnect standard being used based on the XML Namespace that is used
11+
/// Gets the Version of the MTConnect standard from a raw XML document by extracting the root element's namespace URI and dispatching through <see cref="GetByNamespace"/>.
1212
/// </summary>
1313
public static Version Get(string xml)
1414
{
@@ -17,7 +17,7 @@ public static Version Get(string xml)
1717
}
1818

1919
/// <summary>
20-
/// Gets the Version of the MTConnect standard being used based on the XML Namespace that is used
20+
/// Gets the Version of the MTConnect standard from an already-resolved namespace URI. Returns <see cref="MTConnectVersions.Max"/> when the namespace is null, empty, or does not match a declared MTConnect namespace.
2121
/// </summary>
2222
public static Version GetByNamespace(string ns)
2323
{
@@ -46,4 +46,4 @@ public static Version GetByNamespace(string ns)
4646
return MTConnectVersions.Max;
4747
}
4848
}
49-
}
49+
}

0 commit comments

Comments
 (0)