123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
-
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Linq;
- using Tofly.Core.Context.Support;
- using Tofly.Core.Context;
- using Tofly.Core.ServiceLocator;
- using Tofly.CoreUI.Plot;
- using Tofly.CoreUI.Control;
- using Tofly.CoreUI.Message;
- using Tofly.CoreUI.Win.Form.Forms;
- using Tofly.CoreUI.Utils;
- using Tofly.Data.Metadata;
- using Tofly.GIS.Display;
- using Tofly.GISUI.Content;
- using Tofly.GISUI.Controls;
- using Tofly.GIS.Geometry;
- using Tofly.GIS.Carto;
- using Tofly.GIS.SpatialDatabase;
- using Tofly.GIS.Util;
- using Tofly.DataEditUI.Properties;
- using Tofly.GISUI.Plugin;
- using Tofly.Data.General;
- using Tofly.DataEdit.Util;
- namespace Tofly.DataEditUI
- {
-
-
-
- [PluginComponentAttribute((long)Core.SysRegist.ModuleKey.Edit, PluginGISType.ArcGIS, GroupName = "编辑", Caption = "错误标记", Describe = "查看错误标记", IsCreate = true, States = Tofly.CoreUI.Control.Status.STATE_2D)]
- [Tofly.Core.Stereotype.Component(IsSingleton = "false", Name = "Tofly.DataEditUI.ErrorMarkerCommand")]
- public class ErrorMarkerCommand : GISPluginButtonBase
- {
-
-
-
- private IForm _frmErrorMarker;
- public ErrorMarkerCommand()
- {
- this.Enable = true;
- }
- public override void Create(IPluginContent content)
- {
- base.Create(content);
- }
- public override void Click()
- {
- try
- {
- if (this._frmErrorMarker == null)
- {
- Tofly.Data.UserInfo __uinfoCurrent = ServiceLocatorFactory.ServiceLocator.GetInstance<Tofly.Data.UserInfo>(ServiceLocatorKeys.UserInfo);
- ConnectionInfo __connInfo = new ConnectionInfo(__uinfoCurrent.ConnctionInfo);
- IWorkspaceFactory __uwsFactory = ContextRegistry.GetContext().GetObject("WorkspaceFactory_GIS") as IWorkspaceFactory;
- __connInfo.WorkspaceType = WorkspaceType.Oracle;
- IWorkspace __wsProcessing = __uwsFactory.CreateWorkspace(__connInfo);
- this._frmErrorMarker = ContextRegistry.GetContext().GetObject("Tofly.DataEditUI.Win.FormErrorMarker", new object[] { __wsProcessing, this.content }) as IForm;
- this._frmErrorMarker.FormClosedEvent += (fs) =>
- {
- this._frmErrorMarker = null;
- };
- System.Drawing.Rectangle __rectMapcontrol = new System.Drawing.Rectangle();
- GISUI.Utils.WindowStateHelper.GetWindowRect(new IntPtr(this.Mapcontrol.hWnd), ref __rectMapcontrol);
- this._frmErrorMarker.FormStartPosition = FormStartPositionType.Manual;
- this._frmErrorMarker.LocationTop = __rectMapcontrol.Top + 5;
- this._frmErrorMarker.LocationLeft = __rectMapcontrol.Left + 5;
- }
- if (this._frmErrorMarker.Visible == false)
- {
- this._frmErrorMarker.Show(this.content.PluginMainForm);
- }
- else
- {
- this._frmErrorMarker.FormWindowState = FormWindowState.Normal;
- }
- }
- catch(System.Exception ex)
- {
- this._frmErrorMarker = null;
- MessageManager.Show("打开失败: " + ex.Message, "查看错误标记");
- }
- }
- }
- }
|