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.
		
		
		
		
		
			
		
			
				
					
					
						
							86 lines
						
					
					
						
							3.0 KiB
						
					
					
				
			
		
		
	
	
							86 lines
						
					
					
						
							3.0 KiB
						
					
					
				using ESRI.ArcGIS.Carto; | 
						|
using ESRI.ArcGIS.Controls; | 
						|
using ESRI.ArcGIS.Geodatabase; | 
						|
using KGIS.Framework.AE.ExtensionMethod; | 
						|
using KGIS.Framework.Maps; | 
						|
using KGIS.Framework.Utils; | 
						|
using KGIS.Framework.Utils.Helper; | 
						|
using Kingo.Plugin.DataLoad.View; | 
						|
using System; | 
						|
using System.Collections.Generic; | 
						|
using System.Linq; | 
						|
using System.Text; | 
						|
using System.Threading.Tasks; | 
						|
 | 
						|
namespace Kingo.Plugin.DataLoad.Commands | 
						|
{ | 
						|
    /// <summary> | 
						|
    /// 图层数据导出(Shape,GDB,MDB) | 
						|
    /// </summary> | 
						|
    public class CmdLayerDataExport : BaseMapMenuCommand | 
						|
    { | 
						|
        private IEngineEditor editor = null; | 
						|
        private new IHookHelper m_hookHelper = null; | 
						|
        public override void OnClick() | 
						|
        { | 
						|
            try | 
						|
            { | 
						|
                if (editor == null) | 
						|
                { | 
						|
                    editor = new EngineEditorClass(); | 
						|
                } | 
						|
                object pTargetObj = m_hookHelper.GetCustomProperty(); | 
						|
                if (pTargetObj != null) | 
						|
                { | 
						|
                    IFeatureLayer pFeatureLayer = pTargetObj as IFeatureLayer; | 
						|
                    if ((pFeatureLayer.FeatureClass as FeatureClass).Workspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace) | 
						|
                    { | 
						|
                        if (editor.EditState != esriEngineEditState.esriEngineStateEditing) | 
						|
                        { | 
						|
                            MessageHelper.ShowTips("请先开启编辑!"); | 
						|
                            return; | 
						|
                        } | 
						|
                    } | 
						|
                    else | 
						|
                    { | 
						|
                        if (editor.EditState == esriEngineEditState.esriEngineStateEditing) | 
						|
                        { | 
						|
                            MessageHelper.ShowTips("请先停止编辑!"); | 
						|
                            return; | 
						|
                        } | 
						|
                    } | 
						|
                    //数据导出界面初始化 | 
						|
                    FrmDataExport main = new FrmDataExport(pFeatureLayer) | 
						|
                    { | 
						|
                        WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen | 
						|
                    }; | 
						|
                    main.ShowInMainWindow(true); | 
						|
                } | 
						|
            } | 
						|
            catch (Exception ex) | 
						|
            { | 
						|
                PluginServiceInterface.CommonHelper.RecordsErrLog("图层数据导出初始化异常", ex); | 
						|
                MessageHelper.ShowError("图层数据导出初始化异常:" + ex.Message); | 
						|
            } | 
						|
        } | 
						|
 | 
						|
        public override void OnCreate(object Hook) | 
						|
        { | 
						|
            try | 
						|
            { | 
						|
                if (m_hookHelper == null) | 
						|
                { | 
						|
                    m_hookHelper = new HookHelper(); | 
						|
                    m_hookHelper.Hook = Hook; | 
						|
                } | 
						|
                editor = new EngineEditorClass(); | 
						|
            } | 
						|
            catch (Exception ex) | 
						|
            { | 
						|
                PluginServiceInterface.CommonHelper.RecordsErrLog("图层数据导出创建异常", ex); | 
						|
                MessageHelper.ShowError("图层数据导出创建异常:" + ex.Message); | 
						|
            } | 
						|
        } | 
						|
 | 
						|
    } | 
						|
}
 | 
						|
 |