You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
3.0 KiB
82 lines
3.0 KiB
using ESRI.ArcGIS.Controls; |
|
using KGIS.Framework.Platform; |
|
using KGIS.Framework.Utils.Interface; |
|
|
|
namespace Kingo.Plugin.EngineEditor.Commands.Tools |
|
{ |
|
/// <summary> |
|
/// 自定义删除节点命令(用于节点编辑功能) |
|
/// </summary> |
|
public class CustomVertexDeleteCommandChinese : ControlsEditingVertexDeleteCommandClass |
|
{ |
|
|
|
protected string m_caption; |
|
protected bool IsChecked = false; |
|
private IEngineEditor m_engineEditor; |
|
//ControlsEditingVertexDeleteCommand deleteVertexCmd = new ControlsEditingVertexDeleteCommandClass(); |
|
public CustomVertexDeleteCommandChinese() |
|
{ |
|
m_caption = "删除折点"; |
|
} |
|
|
|
public override int Bitmap { get { return base.Bitmap; } } |
|
public override string Caption { get { return m_caption; } } |
|
public override string Category { get { return base.Category; } } |
|
public override bool Checked { get { return IsChecked; } } |
|
public override bool Enabled |
|
{ |
|
get |
|
{ |
|
if (m_engineEditor.CurrentTask != null && m_engineEditor.CurrentTask.UniqueName == "ControlToolsEditing_ModifyFeatureTask") |
|
{ return true; } |
|
else |
|
{ |
|
return false; |
|
} |
|
} |
|
} |
|
public override int HelpContextID { get { return base.HelpContextID; } } |
|
public override string HelpFile { get { return base.HelpFile; } } |
|
public override string Message { get { return base.Message; } } |
|
public override string Name { get { return base.Name; } } |
|
public override string Tooltip { get { return base.Tooltip; } } |
|
|
|
public override void OnCreate(object hook) |
|
{ |
|
base.OnCreate(hook); |
|
if (m_engineEditor == null) |
|
{ |
|
m_engineEditor = new EngineEditorClass(); |
|
} |
|
Platform.Instance.NotifyMsgEven2 += NotifyMsg_NotifyMsgEven;//暂时注销,待改回 |
|
} |
|
bool isActive = false; |
|
void NotifyMsg_NotifyMsgEven(NotifyMsgPackage obj) |
|
{ |
|
if (obj.MsgType == "ResultEditVertexCommand") |
|
{ |
|
isActive = obj.Content is CustomVertexDeleteCommandChinese; |
|
IsChecked = isActive; |
|
} |
|
} |
|
|
|
public override void OnClick() |
|
{ |
|
//判断当前命令是否有效,防止出现内存受保护的异常 |
|
if (!isActive) |
|
{ |
|
isActive = true; |
|
IsChecked = true; |
|
Platform.Instance.SendMsg(new NotifyMsgPackage() { MsgType = "EditVertexCommand", Content = this });//暂时注销,待改回 |
|
//base.OnClick(); |
|
} |
|
else |
|
{ |
|
isActive = false; |
|
IsChecked = false; |
|
Platform.Instance.SendMsg(new NotifyMsgPackage() { MsgType = "ExitVertexCommand", Content = this }); |
|
} |
|
} |
|
|
|
} |
|
}
|
|
|