update XML IO pattern.

This commit is contained in:
2026-05-24 14:06:51 +08:00
parent 058003f395
commit d7836db45f
314 changed files with 13376 additions and 573 deletions
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Delegate XFactory.XGeneratorDelegate | HiAPI-C# 2025 ">
<meta name="description" content="Delegate for generating objects from XML elements with relative file path.">
<meta name="description" content="Delegate for generating an object from an XML element with relative file path context.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
@@ -97,7 +97,8 @@ Delegate XFactory.XGeneratorDelegate
<dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
</div>
<div class="markdown summary"><p>Delegate for generating objects from XML elements with relative file path.</p>
<div class="markdown summary"><p>Delegate for generating an object from an XML element with relative
file path context.</p>
</div>
<div class="markdown conceptual"></div>
@@ -108,26 +109,26 @@ Delegate XFactory.XGeneratorDelegate
<h4 class="section">Parameters</h4>
<dl class="parameters">
<dt><code>src</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.xml.linq.xelement">XElement</a></dt>
<dd><p>The source XML element</p>
<dd><p>The source XML element.</p>
</dd>
<dt><code>baseDirectory</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The base directory for resolving paths</p>
<dd><p>The base directory for resolving paths.</p>
</dd>
<dt><code>relFile</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
<dd><p>The relative file path</p>
<dd><p>The relative file path.</p>
</dd>
<dt><code>progress</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iprogress-1">IProgress</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</dt>
<dd><p>Progress reporter for the XML parsing chain</p>
<dd><p>Progress reporter for the XML parsing chain.</p>
</dd>
<dt><code>res</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>[]</dt>
<dd><p>Additional parameters for generation</p>
<dd><p>Additional parameters for generation.</p>
</dd>
</dl>
<h4 class="section">Returns</h4>
<dl class="parameters">
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></dt>
<dd><p>The generated object</p>
<dd><p>The generated object.</p>
</dd>
</dl>
@@ -165,8 +166,9 @@ Delegate XFactory.XGeneratorDelegate
<h2 id="Hi_Common_XmlUtils_XFactory_XGeneratorDelegate_remarks">Remarks</h2>
<div class="markdown level0 remarks"><p>Note that the design pattern of seperating BaseDirectory and RelativePath is for easy data package moving.
The pattern assume the BaseDirectory can be changed if all the content in the BaseDirectory is changed to the destinate directory.</p>
<div class="markdown level0 remarks"><p>Separating <code class="paramref">baseDirectory</code> and <code class="paramref">relFile</code>
keeps data packages relocatable: moving the whole base directory only
requires updating the directory string, not every internal path.</p>
</div>