• 大小: 70KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-05-23
  • 语言: C#
  • 标签: C#  Arcgis  

资源简介

从pudn上找来的源码,但是自己没有编译成功,可能给出的资源不全。请有兴趣的高人给指点一下。

资源截图

代码片段和文件信息

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 RasterInterpolate
{
    /// 
    /// 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 ToolbatControl
            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;
            }

            //allow the user to save the current document
            DialogResult res = MessageBox.Show(“Would you like to save the current document?“ “AoView“ MessageBoxButtons.YesNo MessageBoxIcon.Question);
            if (res == DialogResult.Yes)
            {
                //launch the save command (why work hard!?)
                ICommand command = new ControlsSaveAsDocCommandClass();
                command.OnCreate(m_hookHelper.Hook);
                command.onclick();
            }

            //craete a new Map
            IMap map = new MapClass();
            map.Name = “Map“;

            //assign the new map to the MapControl
            mapControl.DocumentFilename = string.Empty;
            mapControl.Map = map;
        }

        #endregion
    }
}

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

     文件       2238  2009-02-26 14:22  4\RasterInterpolate\App.ico

     文件      49152  2009-03-06 10:03  4\RasterInterpolate\bin\Debug\RasterInterpolate.exe

     文件       5632  2005-12-08 14:51  4\RasterInterpolate\bin\Debug\RasterInterpolate.vshost.exe

     文件      25600  2009-03-02 22:42  4\RasterInterpolate\bin\Debug\shp\sheet2.dbf

     文件     114688  2009-03-02 22:50  4\RasterInterpolate\bin\Debug\shp\sheet2.mdb

     文件        828  2009-03-02 22:42  4\RasterInterpolate\bin\Debug\shp\sheet2.sbn

     文件        180  2009-03-02 22:42  4\RasterInterpolate\bin\Debug\shp\sheet2.sbx

     文件       1948  2009-03-02 22:42  4\RasterInterpolate\bin\Debug\shp\sheet2.shp

     文件        628  2009-03-02 22:42  4\RasterInterpolate\bin\Debug\shp\sheet2.shx

     文件      29184  2009-03-02 20:18  4\RasterInterpolate\bin\Debug\shp\回归系数及转换后xy坐标.xls

     文件       2962  2009-02-26 14:22  4\RasterInterpolate\CreateNewDocument.cs

     文件       2238  2009-02-26 14:22  4\RasterInterpolate\Earth.ico

     文件       1210  2009-03-04 22:29  4\RasterInterpolate\FrmSet.cs

     文件       6648  2009-03-04 22:29  4\RasterInterpolate\FrmSet.Designer.cs

     文件       5814  2009-03-04 22:29  4\RasterInterpolate\FrmSet.resx

     文件      30662  2009-03-06 10:05  4\RasterInterpolate\MainForm.cs

     文件      15320  2009-03-03 15:40  4\RasterInterpolate\MainForm.Designer.cs

     文件      17259  2009-03-03 15:40  4\RasterInterpolate\MainForm.resx

     文件        991  2009-03-02 15:46  4\RasterInterpolate\OleData.cs

     文件        518  2009-02-26 14:22  4\RasterInterpolate\Program.cs

     文件       1282  2009-02-26 14:22  4\RasterInterpolate\Properties\AssemblyInfo.cs

     文件       2900  2009-02-26 14:22  4\RasterInterpolate\Properties\Resources.Designer.cs

     文件       5612  2009-02-26 14:22  4\RasterInterpolate\Properties\Resources.resx

     文件       1100  2009-02-26 14:22  4\RasterInterpolate\Properties\Settings.Designer.cs

     文件        249  2009-02-26 14:22  4\RasterInterpolate\Properties\Settings.settings

     文件       6581  2009-03-03 14:43  4\RasterInterpolate\RasterInterpolate.csproj

     文件        940  2009-02-26 14:22  4\RasterInterpolate\RasterInterpolate.sln

    ..A..H.     28160  2009-03-03 17:23  4\RasterInterpolate\RasterInterpolate.suo

     文件        940  2009-02-26 14:22  4\RasterInterpolate.sln

    ..A..H.     28160  2009-11-14 09:55  4\RasterInterpolate.suo

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

评论

共有 条评论