资源简介
二次开发实验,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 YLealgeEyes
{
///
/// 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:
engineEditor.StopE
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-04-12 19:38 实验4 (010312927 杨露)\
目录 0 2015-04-12 19:38 实验4 (010312927 杨露)\YLealgeEyes\
目录 0 2015-04-12 19:38 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\
文件 875 2015-04-09 08:44 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes.sln
文件 26112 2015-04-12 19:37 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes.suo
文件 2238 2015-04-09 08:11 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\App.ico
目录 0 2015-04-12 14:30 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\
目录 0 2015-04-12 19:38 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\
文件 20280 2011-01-18 18:27 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\Microsoft.Office.Interop.SmartTag.dll
文件 781104 2011-01-18 18:27 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\Microsoft.Office.Interop.Word.dll
文件 1648465 2011-01-18 21:08 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\Microsoft.Office.Interop.Word.xm
文件 64288 2011-01-18 18:27 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\Microsoft.Vbe.Interop.dll
文件 416544 2011-01-18 18:27 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\office.dll
文件 647452 2011-01-18 21:08 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\office.xm
文件 33280 2015-04-12 16:05 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\YLealgeEyes.exe
文件 34304 2015-04-12 16:05 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\YLealgeEyes.pdb
文件 11600 2015-04-12 16:45 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\YLealgeEyes.vshost.exe
文件 490 2009-08-31 00:40 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\bin\Debug\YLealgeEyes.vshost.exe.manifest
文件 3873 2015-04-09 08:11 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\CreateNewDocument.cs
文件 2238 2015-04-09 08:11 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\Earth.ico
文件 7031 2015-04-12 16:05 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\MainForm.cs
文件 16178 2015-04-12 16:05 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\MainForm.Designer.cs
文件 20674 2015-04-12 15:58 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\MainForm.resx
目录 0 2015-04-12 14:30 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\
目录 0 2015-04-12 14:30 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\
目录 0 2015-04-12 19:38 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\
文件 122572 2015-04-12 14:34 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7139 2015-04-12 16:05 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 666 2015-04-12 16:01 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\GenerateResource.read.1.tlog
文件 774 2015-04-12 16:01 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\GenerateResource.write.1.tlog
目录 0 2015-04-12 14:30 实验4 (010312927 杨露)\YLealgeEyes\YLealgeEyes\obj\x86\Debug\TempPE\
............此处省略18个文件信息
评论
共有 条评论