18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

BUILDING APPLICATIONS WITH WINDOWS CONTROLS<br />

Rather than walk through this scenario, you can<br />

get the completed application from the samples<br />

installation location. The sample is installed as<br />

part of the <strong>ArcGIS</strong> developer samples.<br />

The <strong>ArcGIS</strong> developer samples are not included<br />

in the typical installation of the <strong>ArcGIS</strong> <strong>Engine</strong><br />

<strong>Developer</strong> Kit. If you do not have them installed,<br />

rerun the <strong>Developer</strong> Kit Install wizard, click<br />

Custom or Modify, and click the samples feature<br />

under Software <strong>Developer</strong> Kit.<br />

This walkthrough is for developers who want to build and deploy an application<br />

using .NET. It describes the process of building and deploying an application<br />

using the <strong>ArcGIS</strong> controls.<br />

You can find this sample in:<br />

\<strong>Developer</strong>Kit\samples\<strong>Developer</strong>_<strong>Guide</strong>_Scenarios\<br />

Building_an_<strong>ArcGIS</strong>_Controls_Map_Viewer_ApplicationCSharp.zip<br />

PROJECT DESCRIPTION<br />

The goal of the ‘Building applications with Windows Controls’ scenario is to<br />

demonstrate and familiarize you with the steps required to develop and deploy a<br />

GIS application using the standard <strong>ArcGIS</strong> controls within the Microsoft Visual<br />

Studio .NET API. The scenario uses the MapControl, PageLayoutControl,<br />

TOCControl, ToolbarControl, and LicenseControl as Windows Controls within<br />

the Microsoft Visual Studio .NET development environment. COM, Java, and<br />

C++ programmers should refer to the following scenarios: ‘Building applications<br />

with ActiveX’, ‘Building applications with visual JavaBeans’, ‘Building a command-line<br />

Java application’, and ‘Building a command-line C++ application’.<br />

The scenario demonstrates the steps required to create a GIS application for<br />

viewing preauthored ESRI map documents, or MXDs. The scenario covers the<br />

following techniques:<br />

• Loading and embedding the <strong>ArcGIS</strong> controls in Microsoft Visual Studio .NET.<br />

• Loading preauthored map documents into MapControl and<br />

PageLayoutControl.<br />

• Setting ToolbarControl and TOCControl buddy controls.<br />

• Handling form resize.<br />

• Adding <strong>ArcGIS</strong> <strong>Engine</strong> commands and tools to the ToolbarControl.<br />

• Creating popup menus.<br />

• Managing label editing in the TOCControl.<br />

• Drawing shapes on the MapControl.<br />

• Creating a custom tool to work with the MapControl, PageLayoutControl,<br />

and ToolbarControl.<br />

• Customizing the ToolbarControl.<br />

• License configuration using the LicenseControl.<br />

• Deploying the application onto a Windows operating system.<br />

CONCEPTS<br />

This scenario is implemented using the Microsoft Visual Studio .NET development<br />

environment and uses the ESRI interop assemblies to host the <strong>ArcGIS</strong><br />

controls inside .NET Windows Controls in a .NET form. These interoperability<br />

assemblies act as a bridge between the unmanaged code of COM and the managed<br />

.NET code. Any references to the members of the COM <strong>ArcGIS</strong> controls<br />

are routed to the interop assemblies and forwarded to the actual COM object.<br />

Likewise, responses from the COM object are routed to the interop assembly and<br />

forwarded to the .NET application. Each <strong>ArcGIS</strong> <strong>Engine</strong> control has events,<br />

properties, and methods that can be accessed once embedded within a container,<br />

Chapter 6 • <strong>Developer</strong> scenarios • 331

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!