This commit is contained in:
2025-10-13 00:24:11 +08:00
parent 32e3248b8c
commit b8c48b9521
37 changed files with 2334 additions and 1427 deletions
@@ -107,6 +107,7 @@
<ol>
<li><strong>Parent ConnectionId Passing</strong>: Child hubs copy parent's function references via connectionId</li>
<li><strong>Frontend ConnectionId Chain</strong>: Components pass connectionId down the hierarchy</li>
<li><strong>Wrapper Function Pattern</strong>: Child hubs should create wrapper functions that dynamically retrieve and invoke parent functions at runtime, rather than directly copying references. This ensures type safety through runtime checking and supports dynamic function updates from the parent.</li>
</ol>
<h2 id="benefits">Benefits</h2>
<ul>
@@ -119,6 +120,7 @@
<ul>
<li>Apply or inherit from DictionaryHub for auto-cleanup</li>
<li>Use meaningful key names (e.g., &ldquo;transformer-getter&rdquo;)</li>
<li>Always setup dictionary functions unconditionally during initialization - put condition checks inside the functions, not around the setup. This ensures child panels can access functions even when parent objects temporarily don't meet the conditions.</li>
</ul>
<h2 id="common-pitfalls">Common Pitfalls</h2>
<ul>
@@ -162,10 +162,7 @@ namespace HiNC_2025_win_desktop.Geom
private bool _isTextMode = false;
private bool _isReadOnly = false;
// 用于匹配各种格式的正则表达式
private static readonly Regex VectorRegex = new Regex(@&quot;^\s*[\(\[\{]?\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*[\)\]\}]?\s*$&quot;, RegexOptions.Compiled);
// 用于匹配变换矩阵格式的正则表达式(包括带有花括号的嵌套格式)
private static readonly Regex MatrixRegex = new Regex(@&quot;\{(?:\s*\{?\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*\}?\s*,){3}\s*\{?\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*,\s*(-?\d*\.?\d+)\s*\}?\s*\}&quot;, RegexOptions.Compiled);
public event PropertyChangedEventHandler PropertyChanged;
@@ -568,10 +565,10 @@ namespace HiNC_2025_win_desktop.Geom
<ul>
<li>Geom/Vec3dControl</li>
</ul>
<h3 id="web-page-application-source-code-path">Web Page Application Source Code Path</h3>
<h3 id="web-service-application-source-code-path">Web Service Application Source Code Path</h3>
<ul>
<li>wwwroot/widget/vec3d-control.js</li>
<li>Controller/Widget/WidgetController.cs</li>
<li>Widget/Vec3dHub.cs</li>
</ul>
</article>