Archived
deploy webservice static-file routing for docsite folder URLs, per-instance step-cache db, and constant-height panel title bars.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Class ResourceUtil | HiAPI-C# 2025 ">
|
||||
|
||||
<meta name="description" content="Utility class for working with resource managers and localized strings.">
|
||||
<meta name="description" content="Utility class for working with resource managers and localized strings, and the home of the attribute-declared command vocabulary: the declarations of an assembly, exposed as &ldquo;type/member + culture → text&rdquo; queries and as instances, with GUI-layer overrides layered on top ().">
|
||||
<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,12 @@ Class ResourceUtil
|
||||
<dl><dt>Assembly</dt><dd>HiGeom.dll</dd></dl>
|
||||
</div>
|
||||
|
||||
<div class="markdown summary"><p>Utility class for working with resource managers and localized strings.</p>
|
||||
<div class="markdown summary"><p>Utility class for working with resource managers and localized strings,
|
||||
and the home of the attribute-declared command vocabulary: the
|
||||
<a class="xref" href="Hi.Common.CultureTextAttribute.html">CultureTextAttribute</a> declarations of an assembly, exposed as
|
||||
“type/member + culture → text” queries and as
|
||||
<a class="xref" href="Hi.Common.ICommandTextSource.html">ICommandTextSource</a> instances, with GUI-layer overrides
|
||||
layered on top (<a class="xref" href="Hi.Common.ResourceUtil.html#Hi_Common_ResourceUtil_SetTextOverride_System_String_System_String_System_String_">SetTextOverride(string, string, string)</a>).</p>
|
||||
</div>
|
||||
<div class="markdown conceptual"></div>
|
||||
|
||||
@@ -149,293 +154,57 @@ Class ResourceUtil
|
||||
|
||||
|
||||
|
||||
<h2 class="section" id="fields">Fields
|
||||
</h2>
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_CoatingMaterialFolder" data-uid="Hi.Common.ResourceUtil.CoatingMaterialFolder">
|
||||
CoatingMaterialFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the coating material resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string CoatingMaterialFolder = "Resource/CoatingMaterial"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_CutterFolder" data-uid="Hi.Common.ResourceUtil.CutterFolder">
|
||||
CutterFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the cutter resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string CutterFolder = "Resource/Cutter"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_CuttingParameterFolder" data-uid="Hi.Common.ResourceUtil.CuttingParameterFolder">
|
||||
CuttingParameterFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the cutting parameter resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string CuttingParameterFolder = "Resource/CuttingParameter"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_HolderFolder" data-uid="Hi.Common.ResourceUtil.HolderFolder">
|
||||
HolderFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the holder resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string HolderFolder = "Resource/Holder"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_MachineToolFolder" data-uid="Hi.Common.ResourceUtil.MachineToolFolder">
|
||||
MachineToolFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the machine tool resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string MachineToolFolder = "Resource/MachineTool"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_ResourceFolder" data-uid="Hi.Common.ResourceUtil.ResourceFolder">
|
||||
ResourceFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the main resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string ResourceFolder = "Resource"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_SpindleCapabilityFolder" data-uid="Hi.Common.ResourceUtil.SpindleCapabilityFolder">
|
||||
SpindleCapabilityFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the spindle capability resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string SpindleCapabilityFolder = "Resource/SpindleCapability"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_StructureMaterialFolder" data-uid="Hi.Common.ResourceUtil.StructureMaterialFolder">
|
||||
StructureMaterialFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the structure material resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string StructureMaterialFolder = "Resource/StructureMaterial"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_WorkpieceMaterialFolder" data-uid="Hi.Common.ResourceUtil.WorkpieceMaterialFolder">
|
||||
WorkpieceMaterialFolder
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Gets the path to the workpiece material resource folder.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public const string WorkpieceMaterialFolder = "Resource/WorkpieceMaterial"</code></pre>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<h4 class="section">Field Value</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<h2 class="section" id="methods">Methods
|
||||
</h2>
|
||||
|
||||
|
||||
<a id="Hi_Common_ResourceUtil_GenTextSource_" data-uid="Hi.Common.ResourceUtil.GenTextSource*"></a>
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_GenTextSource_System_Globalization_CultureInfo_System_Type___" data-uid="Hi.Common.ResourceUtil.GenTextSource(System.Globalization.CultureInfo,System.Type[])">
|
||||
GenTextSource(CultureInfo, params Type[])
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Generates an <a class="xref" href="Hi.Common.ICommandTextSource.html">ICommandTextSource</a> carrying
|
||||
<code class="paramref">culture</code>, resolving keys against the
|
||||
<a class="xref" href="Hi.Common.CultureTextAttribute.html">CultureTextAttribute</a> declarations of the
|
||||
<code class="paramref">vocabTypes</code>' assemblies plus the registered
|
||||
overrides — the engine-default localizer a caller injects into
|
||||
title-composing commands.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public static ICommandTextSource GenTextSource(CultureInfo culture, params Type[] vocabTypes)</code></pre>
|
||||
</div>
|
||||
|
||||
<h4 class="section">Parameters</h4>
|
||||
<dl class="parameters">
|
||||
<dt><code>culture</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></dt>
|
||||
<dd><p>Culture the source carries; null takes the current UI culture.</p>
|
||||
</dd>
|
||||
<dt><code>vocabTypes</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.type">Type</a>[]</dt>
|
||||
<dd><p>Types anchoring the assemblies whose declarations feed the source.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4 class="section">Returns</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="Hi.Common.ICommandTextSource.html">ICommandTextSource</a></dt>
|
||||
<dd><p>The text source.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a id="Hi_Common_ResourceUtil_GetStringOrDefault_" data-uid="Hi.Common.ResourceUtil.GetStringOrDefault*"></a>
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_GetStringOrDefault_System_Resources_ResourceManager_System_String_" data-uid="Hi.Common.ResourceUtil.GetStringOrDefault(System.Resources.ResourceManager,System.String)">
|
||||
@@ -518,6 +287,95 @@ The default value is the <code class="paramref">name</code> itself.</p>
|
||||
|
||||
|
||||
|
||||
<a id="Hi_Common_ResourceUtil_GetText_" data-uid="Hi.Common.ResourceUtil.GetText*"></a>
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_GetText_System_Reflection_MemberInfo_System_Globalization_CultureInfo_" data-uid="Hi.Common.ResourceUtil.GetText(System.Reflection.MemberInfo,System.Globalization.CultureInfo)">
|
||||
GetText(MemberInfo, CultureInfo)
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>The text of <code class="paramref">member</code>'s vocabulary key in
|
||||
<code class="paramref">culture</code> — the “type/member + culture → text” query.
|
||||
Resolution walks the culture's parent chain; on each level a
|
||||
registered override (<a class="xref" href="Hi.Common.ResourceUtil.html#Hi_Common_ResourceUtil_SetTextOverride_System_String_System_String_System_String_">SetTextOverride(string, string, string)</a>) outranks the
|
||||
member assembly's <a class="xref" href="Hi.Common.CultureTextAttribute.html">CultureTextAttribute</a> declaration. With
|
||||
no match the key itself — the English default — is returned.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public static string GetText(MemberInfo member, CultureInfo culture)</code></pre>
|
||||
</div>
|
||||
|
||||
<h4 class="section">Parameters</h4>
|
||||
<dl class="parameters">
|
||||
<dt><code>member</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.reflection.memberinfo">MemberInfo</a></dt>
|
||||
<dd><p>The type or member owning the vocabulary key.</p>
|
||||
</dd>
|
||||
<dt><code>culture</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></dt>
|
||||
<dd><p>Wanted culture; null takes the current UI culture.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h4 class="section">Returns</h4>
|
||||
<dl class="parameters">
|
||||
<dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd><p>The culture's text, or the key itself.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a id="Hi_Common_ResourceUtil_SetTextOverride_" data-uid="Hi.Common.ResourceUtil.SetTextOverride*"></a>
|
||||
|
||||
<h3 id="Hi_Common_ResourceUtil_SetTextOverride_System_String_System_String_System_String_" data-uid="Hi.Common.ResourceUtil.SetTextOverride(System.String,System.String,System.String)">
|
||||
SetTextOverride(string, string, string)
|
||||
|
||||
</h3>
|
||||
|
||||
<div class="markdown level1 summary"><p>Registers a GUI-layer text for a vocabulary key in one culture. An
|
||||
override outranks the assembly's own <a class="xref" href="Hi.Common.CultureTextAttribute.html">CultureTextAttribute</a>
|
||||
declaration in that culture, and may add a culture the assembly never
|
||||
declared. Process-level; typically called once at GUI startup.</p>
|
||||
</div>
|
||||
<div class="markdown level1 conceptual"></div>
|
||||
|
||||
<div class="codewrapper">
|
||||
<pre><code class="lang-csharp hljs">public static void SetTextOverride(string cultureName, string key, string text)</code></pre>
|
||||
</div>
|
||||
|
||||
<h4 class="section">Parameters</h4>
|
||||
<dl class="parameters">
|
||||
<dt><code>cultureName</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd><p>Culture name the text is written in (e.g. <code>zh-Hant</code>).</p>
|
||||
</dd>
|
||||
<dt><code>key</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd><p>Vocabulary key — the English default text.</p>
|
||||
</dd>
|
||||
<dt><code>text</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
|
||||
<dd><p>The overriding text; null removes the override.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user