using KGIS.Framework.Commands; using KGIS.Framework.Utils; using KGIS.Framework.Utils.Helper; using System; using TestMultiGetPointsTranslate.View; namespace TestMultiGetPointsTranslate.Commands { /// /// 多窗口取点矫正 /// public class CmdMultiGetPointsTranslateForm : BaseMenuCommand { TestMultiGetPointsTranslateForm ucMultiGetPointsTranslateForm = null; public override void OnClick() { try { if (ucMultiGetPointsTranslateForm == null) { ucMultiGetPointsTranslateForm = new TestMultiGetPointsTranslateForm(); ucMultiGetPointsTranslateForm.Closed += UCMultiGetPointsTranslateViewForm_Closed; } ucMultiGetPointsTranslateForm.Text = "影像配准纠正软件"; ucMultiGetPointsTranslateForm.ShowInMainForm(); } catch (Exception ex) { LogAPI.Debug(ex); MessageHelper.ShowError("多窗口取点矫正出现错误,可能的原因是:" + ex.Message); } } private void UCMultiGetPointsTranslateViewForm_Closed(object sender, EventArgs e) { if (ucMultiGetPointsTranslateForm != null) { ucMultiGetPointsTranslateForm = null; } } public override void OnCreate(object Hook) { } public override bool Enabled { get { return KGIS.Framework.Maps.MapsManager.Instance.MapService.GetProjectInfo() == null ? false : true; } } } }