phase 2b: add AliasTreePlugin DockPanePlugin entry + wiring
- AliasTreePlugin.cs: DockPanePlugin with ElementHost wrapper - XAML: wire Expanded/Selected event handlers via TreeViewItem - Both projects compile, plugin deployed to Navisworks
This commit is contained in:
parent
f3392ddbf6
commit
56d18c696c
@ -148,6 +148,7 @@
|
||||
<Compile Include="src\Core\Database\BackupManager.cs" />
|
||||
<Compile Include="src\Core\AliasTree\AliasNodeIdentity.cs" />
|
||||
<Compile Include="src\Core\AliasTree\AliasDataStore.cs" />
|
||||
<Compile Include="src\Core\AliasTree\AliasTreePlugin.cs" />
|
||||
<Compile Include="src\Core\Services\TimeTagCalculator.cs" />
|
||||
<Compile Include="src\Core\Services\TimeTagService.cs" />
|
||||
<Compile Include="src\Core\Services\TimeTagExporter.cs" />
|
||||
|
||||
51
src/Core/AliasTree/AliasTreePlugin.cs
Normal file
51
src/Core/AliasTree/AliasTreePlugin.cs
Normal file
@ -0,0 +1,51 @@
|
||||
using Autodesk.Navisworks.Api.Plugins;
|
||||
using NavisworksTransport.UI.WPF.Views;
|
||||
using NavisworksTransport.Utils;
|
||||
using System.Windows.Forms.Integration;
|
||||
|
||||
namespace NavisworksTransport.Core.AliasTree
|
||||
{
|
||||
/// <summary>
|
||||
/// 别名导航树 — DockPanePlugin 入口
|
||||
///
|
||||
/// 使用方式:
|
||||
/// 1. 启动 Navisworks
|
||||
/// 2. View → Docking Windows → 别名导航树
|
||||
/// 3. 手动拖放到内置 Selection Tree 下方
|
||||
/// </summary>
|
||||
[Plugin("NavisworksTransport.AliasTree", "Tian",
|
||||
DisplayName = "别名导航树",
|
||||
ToolTip = "自定义节点别名管理面板 — 双击编辑、右键菜单、JSON 导入导出")]
|
||||
[DockPanePlugin(300, 400, FixedSize = false, AutoScroll = true)]
|
||||
public class AliasTreePlugin : DockPanePlugin
|
||||
{
|
||||
public override System.Windows.Forms.Control CreateControlPane()
|
||||
{
|
||||
LogManager.Info("[别名树] 创建 DockPane 面板");
|
||||
|
||||
var eh = new ElementHost
|
||||
{
|
||||
AutoSize = true
|
||||
};
|
||||
|
||||
var control = new AliasTreeControl();
|
||||
eh.Child = control;
|
||||
eh.CreateControl();
|
||||
|
||||
return eh;
|
||||
}
|
||||
|
||||
public override void DestroyControlPane(System.Windows.Forms.Control pane)
|
||||
{
|
||||
LogManager.Info("[别名树] 销毁 DockPane 面板");
|
||||
|
||||
if (pane is ElementHost eh && eh.Child is AliasTreeControl ctrl)
|
||||
{
|
||||
ctrl.Cleanup();
|
||||
eh.Child = null;
|
||||
}
|
||||
|
||||
pane?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -166,7 +166,9 @@
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
Background="White"
|
||||
BorderThickness="0"
|
||||
ItemContainerStyle="{StaticResource AliasTreeViewItemStyle}">
|
||||
ItemContainerStyle="{StaticResource AliasTreeViewItemStyle}"
|
||||
TreeViewItem.Expanded="OnTreeViewItemExpanded"
|
||||
TreeViewItem.Selected="OnTreeViewItemSelected">
|
||||
<TreeView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="编辑别名" Click="OnCtxEditClick">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user