资源简介

AE C# 空间查询(基于点,线,面)带有实验数据,适合初学者

资源截图

代码片段和文件信息

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using ESRI.ArcGIS.ADF.baseClasses;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Controls;
using ESRI.ArcGIS.Carto;
using ESRI.ArcGIS.SystemUI;

namespace MapControlApplication1
{
    /// 
    /// Summary description for CreateNewDocument.
    /// 

    public class CreateNewDocument : baseCommand
    {
        private IHookHelper m_hookHelper = null;

        //constructor
        public CreateNewDocument()
        {
            //update the base properties
            base.m_category = “.NET Samples“;
            base.m_caption = “NewDocument“;
            base.m_message = “Create a new map“;
            base.m_toolTip = “Create a new map“;
            base.m_name = “DotNetTemplate_NewDocumentCommand“;
        }

        #region Overriden Class Methods

        /// 
        /// Occurs when this command is created
        /// 

        /// Instance of the application
        public override void OnCreate(object hook)
        {
            if (m_hookHelper == null)
                m_hookHelper = new HookHelperClass();

            m_hookHelper.Hook = hook;
        }

        /// 
        /// Occurs when this command is clicked
        /// 

        public override void onclick()
        {
            IMapControl3 mapControl = null;

            //get the MapControl from the hook in case the container is a ToolbarControl
            if (m_hookHelper.Hook is IToolbarControl)
            {
                mapControl = (IMapControl3)((IToolbarControl)m_hookHelper.Hook).Buddy;
            }
            //In case the container is MapControl
            else if (m_hookHelper.Hook is IMapControl3)
            {
                mapControl = (IMapControl3)m_hookHelper.Hook;
            }
            else
            {
                MessageBox.Show(“Active control must be MapControl!“ “Warning“ MessageBoxButtons.OK MessageBoxIcon.Exclamation);
                return;
            }

            //check to see if there is an active edit session and whether edits have been made
            DialogResult result;
            IEngineEditor engineEditor = new EngineEditorClass();

            if ((engineEditor.EditState == esriEngineEditState.esriEngineStateEditing) && (engineEditor.HasEdits() == true))
            {
                result = MessageBox.Show(“Would you like to save your edits“ “Save Edits“ MessageBoxButtons.YesNoCancel MessageBoxIcon.Question);

                switch (result)
                {

                    case DialogResult.Cancel:
                        return;

                    case DialogResult.No:
                        engineEditor.StopEditing(false);
                        break;

                    case DialogResult.Yes:
                        engineEd

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2238  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\App.ico

     文件      30720  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\bin\Debug\MapControlApplication1.exe

     文件      36352  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\bin\Debug\MapControlApplication1.pdb

     文件      14328  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\bin\Debug\MapControlApplication1.vshost.exe

     文件        490  2007-07-21 02:33  空间查询(点,线,面)\MapControlApplication1\bin\Debug\MapControlApplication1.vshost.exe.manifest

     文件       3886  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\CreateNewDocument.cs

     文件       2238  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Earth.ico

     文件      11057  2012-03-27 20:04  空间查询(点,线,面)\MapControlApplication1\MainForm.cs

     文件      16744  2012-03-27 19:58  空间查询(点,线,面)\MapControlApplication1\MainForm.Designer.cs

     文件      17333  2012-03-27 19:58  空间查询(点,线,面)\MapControlApplication1\MainForm.resx

     文件       3995  2012-03-27 19:49  空间查询(点,线,面)\MapControlApplication1\MapControlApplication1.csproj

     文件        808  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.csproj.FileListAbsolute.txt

     文件        850  2012-03-27 19:58  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.csproj.GenerateResource.Cache

     文件      30720  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.exe

     文件       8133  2012-03-27 19:58  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.MainForm.resources

     文件      36352  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.pdb

     文件        180  2012-03-27 19:49  空间查询(点,线,面)\MapControlApplication1\obj\Debug\MapControlApplication1.Properties.Resources.resources

     文件     124586  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\obj\Debug\ResolveAssemblyReference.cache

     文件       4608  2012-02-27 20:45  空间查询(点,线,面)\MapControlApplication1\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件        526  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Program.cs

     文件       1316  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Properties\AssemblyInfo.cs

     文件       2868  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Properties\Resources.Designer.cs

     文件       5612  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Properties\Resources.resx

     文件       1120  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Properties\Settings.Designer.cs

     文件        249  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1\Properties\Settings.settings

     文件        956  2012-02-27 20:44  空间查询(点,线,面)\MapControlApplication1.sln

    ..A..H.     15360  2012-03-27 20:05  空间查询(点,线,面)\MapControlApplication1.suo

     文件       4998  2008-07-10 21:41  空间查询(点,线,面)\实验数据\qiyet.dbf

     文件       1132  2008-07-10 21:40  空间查询(点,线,面)\实验数据\qiyet.sbn

     文件        228  2008-07-10 21:40  空间查询(点,线,面)\实验数据\qiyet.sbx

............此处省略14个文件信息

评论

共有 条评论