【正文】
例 ?使用 ProgID 字符串 ?創(chuàng)建并定義一個 UID (傳入 ProgID 或 CLSID參數(shù) ) ?可以在技術(shù)文檔 “Controls Commands” 找到內(nèi)置的命令 , 菜單 , 和工具條 39。Adding a mand by ICommand Dim pCommand As ICommand = New ControlsMapFullExtentCommandClass (pCommand) 39。Adding a mand by ProgID Dim sProgID As String = (sProgID) 39。Adding a mand by UID Dim pUid As New UIDClass = (pUid) Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 332 加載項的不同方法 Public Sub AddMapCommands() 39。Add items to the ToolbarControl Dim pUid As New UID = (pUid, , 1, True, 2, ) = (pUid, 1, False, 2, ) = (pUid, 1, False, 2) End Sub ?三方法 ? AddItem, AddToolbarDef, AddMenuItem ?多參數(shù) ? UID, subtype, index, begin group, group spacing, style Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 333 ArcReaderControl vs. ReaderControl ? ArcReaderControl ?屬于 ArcGIS Desktop ?需要有 ArcGIS Publisher extension才能使用 ?能構(gòu)建和分發(fā)獨立應(yīng)用程序 ?需要安裝 ArcReader ? ReaderControl ?屬于 ArcGIS Engine ?需要 ArcGIS Engine Runtime Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 334 ArcReaderControl vs. ReaderControl (續(xù) ) ArcReaderControl ReaderControl 需要的許可 ArcGIS Publisher Extension License ArcGIS Engine Designer License 需要的 runtime 獨立的 ArcReader 應(yīng)用程序 被許可的 ArcGIS Engine Runtime 支持的 API39。s COM (ActiveX Control), .NET (Windows Control) COM (ActiveX Control), .NET (Windows Control), Java (Visual Java Bean), C++ (Motif Wigit) 支持的平臺 Windows Windows, UNIX 包括一組 Reader 命令 No Yes CoCreatable objects ArcReaderSearchDef, ArcReaderConfiguration ARSearchDef, ARConfiguration 是否可以用 ArcObjects來擴展 No Yes, for PMFs published with permission to load into a customized application, and published with unrestricted access to its contents 與 ToolbarControl 和 TOCControl協(xié)同開發(fā)應(yīng)用 No Yes, for PMFs published with permission to load into a customized application, and published with unrestricted access to its contents Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 335 ArcReaderControl 和 ReaderControl OMD ?簡化而強大的一組對象 Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 336 ReaderControl 命令 ? Commands ? Tools ? ToolControls ? Toolbars Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 337 使用 ReaderControl ?加載 PMF 文檔 ?更改控件的外形 ?顯示任何可獲取的窗口 : ShowARWindow Private Sub Form1_Load(…) Handles Dim readerControl As IARControl readerControl = 39。Load pmf file Dim fileName As String = C:\arcgis\ArcTutor\ArcReader and Publisher\Gulf of St. If (fileName) Then (fileName, ) End If 39。Specify appearance of reader control = = = False 39。Determine whether the magnifier window is open If () = False Then 39。Show the magnifier window (, True) End If End Sub Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 338 練習 3 總結(jié) ?創(chuàng)建一個控件應(yīng)用程序 ?使用 MapDocument 和 ObjectCopy ?使用控件成員 ?使用工具條和 TOC控件 ?加載 MXD 文檔 ?保存新文檔 Developing Applications with ArcGIS Engine Copyright 169。 2022 ESRI. All rights reserved. 339 課 3 回顧 ? MapControl控件和 SceneControl控件不同點主要有哪些 ? ?什么是框架控件應(yīng)用程序 ? ?項是怎樣被加載到工具條控件上去的 ? ?如何用 MapDocument 類來幫助開發(fā) ? ? ObjectCopy 能用來做什么 ?