资源简介

ArcGIS Engine影像处理和分类

资源截图

代码片段和文件信息

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 MapControlFunction
{
    /// 
    /// 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 Overridden 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:
                        engineEdito

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

     文件        896  2012-02-25 16:38  MapControlFunction\MapControlFunction.sln

    ..A..H.     24576  2012-02-28 23:16  MapControlFunction\MapControlFunction.suo

     文件        144  2012-02-25 16:56  MapControlFunction\MapControlFunction\app.config

     文件       2238  2012-02-25 16:38  MapControlFunction\MapControlFunction\App.ico

     文件       3883  2012-02-25 16:38  MapControlFunction\MapControlFunction\CreateNewDocument.cs

     文件       2238  2012-02-25 16:38  MapControlFunction\MapControlFunction\Earth.ico

     文件       8744  2012-02-28 23:16  MapControlFunction\MapControlFunction\MainForm.cs

     文件      15304  2012-02-28 21:43  MapControlFunction\MapControlFunction\MainForm.Designer.cs

     文件      17693  2012-02-28 21:43  MapControlFunction\MapControlFunction\MainForm.resx

     文件       7637  2012-02-27 22:50  MapControlFunction\MapControlFunction\MapControlFunction.csproj

     文件        452  2012-02-25 16:56  MapControlFunction\MapControlFunction\MapControlFunction.csproj.user

     文件        839  2012-02-25 16:38  MapControlFunction\MapControlFunction\Program.cs

     文件      30720  2012-02-28 22:02  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.exe

     文件        144  2012-02-25 16:56  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.exe.config

     文件      34304  2012-02-28 22:02  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.pdb

     文件      11600  2012-02-28 22:05  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.vshost.exe

     文件        144  2012-02-25 16:56  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.vshost.exe.config

     文件        490  2010-03-17 22:39  MapControlFunction\MapControlFunction\bin\Debug\MapControlFunction.vshost.exe.manifest

     文件     117862  2012-02-27 22:31  MapControlFunction\MapControlFunction\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7236  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        620  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\GenerateResource.read.1.tlog

     文件        714  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\GenerateResource.write.1.tlog

     文件        968  2012-02-28 22:05  MapControlFunction\MapControlFunction\obj\x86\Debug\MapControlFunction.csproj.FileListAbsolute.txt

     文件      30720  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\MapControlFunction.exe

     文件       8386  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\MapControlFunction.MainForm.resources

     文件      34304  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\MapControlFunction.pdb

     文件        180  2012-02-27 22:50  MapControlFunction\MapControlFunction\obj\x86\Debug\MapControlFunction.Properties.Resources.resources

     文件     131733  2012-02-28 22:02  MapControlFunction\MapControlFunction\obj\x86\Debug\ResolveAssemblyReference.cache

     文件       4608  2012-02-27 22:31  MapControlFunction\MapControlFunction\obj\x86\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1298  2012-02-25 16:38  MapControlFunction\MapControlFunction\Properties\AssemblyInfo.cs

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

评论

共有 条评论