添加项目文件。
This commit is contained in:
60
ShrlAlgo.MsAddIns/CustomTool.cs
Normal file
60
ShrlAlgo.MsAddIns/CustomTool.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using Bentley.DgnPlatformNET;
|
||||
using Bentley.DgnPlatformNET.Elements;
|
||||
using Bentley.MstnPlatformNET;
|
||||
|
||||
using ShrlAlgo.MsAddins.Views;
|
||||
|
||||
|
||||
namespace ShrlAlgo.MsAddIns
|
||||
{
|
||||
internal class CustomTool : DgnElementSetTool
|
||||
{
|
||||
private static CustomTool _toolSettings;
|
||||
private static CustomToolSettings customToolSettings;
|
||||
private readonly AddIn addin;
|
||||
|
||||
public CustomTool(AddIn addin) : base(0, 0)
|
||||
{
|
||||
this.addin = addin;
|
||||
}
|
||||
|
||||
protected override bool OnInstall()
|
||||
{
|
||||
base.OnInstall();
|
||||
|
||||
// 初始化工具设置对话框
|
||||
if (_toolSettings == null)
|
||||
_toolSettings = new CustomTool(addin);
|
||||
if (customToolSettings == null)
|
||||
{
|
||||
customToolSettings = new CustomToolSettings();
|
||||
}
|
||||
customToolSettings.Attach(addin);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnRestartTool()
|
||||
{
|
||||
_toolSettings.InstallTool();
|
||||
}
|
||||
protected override bool OnResetButton(DgnButtonEvent ev)
|
||||
{
|
||||
customToolSettings.Detach();
|
||||
ExitTool();//退出工具
|
||||
return true;//返回
|
||||
}
|
||||
|
||||
public static void InstallNewTool()
|
||||
{
|
||||
_toolSettings = new CustomTool(MsAddIns.AddIn);
|
||||
customToolSettings = new CustomToolSettings();
|
||||
_toolSettings.InstallTool();
|
||||
}
|
||||
|
||||
public override StatusInt OnElementModify(Element element)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user