com.esri.arcgis.controls
Interface IHookHelper

All Superinterfaces:
Serializable
All Known Implementing Classes:
HookHelper

public interface IHookHelper
extends Serializable

Provides access to members needed when developing commands to work with the MapControl, PageLayoutControl, ArcMap, and custom controls and applications.

Description

Use the IHookHelper interface to return the ActiveView, PageLayout or FocusMap of the hook passed to the ICommand::OnCreate event regardless of whether the hook is a MapControl, PageLayoutControl, ToolbarControl or ArcMap.

Product Availability

Available with ArcGIS Engine.


Method Summary
 IActiveView getActiveView()
          Active view of hooked control or application.
 IMap getFocusMap()
          Focus map of hooked control or application.
 Object getHook()
          Hook object that should be the same as the hook object passed in ICommand::OnCreate.
 IOperationStack getOperationStack()
          Operation stack of hooked control or application used for undo/redo operations.
 IPageLayout getPageLayout()
          Page layout of hooked control or application.
 void setHookByRef(Object ppHook)
          Hook object that should be the same as the hook object passed in ICommand::OnCreate.
 

Method Detail

setHookByRef

void setHookByRef(Object ppHook)
                  throws IOException,
                         AutomationException
Hook object that should be the same as the hook object passed in ICommand::OnCreate.

Product Availability

Available with ArcGIS Engine.

Parameters:
ppHook - A reference to another Automation Object (IDispatch) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getHook

Object getHook()
               throws IOException,
                      AutomationException
Hook object that should be the same as the hook object passed in ICommand::OnCreate.

Description

The hook that is passed to the ICommand::OnCreate event. The hook is a MapControl, PageLayoutControl, ToolbarControl or ArcMap.

Product Availability

Available with ArcGIS Engine.

Returns:
A reference to another Automation Object (IDispatch)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getActiveView

IActiveView getActiveView()
                          throws IOException,
                                 AutomationException
Active view of hooked control or application.

Description

The IActiveView of the hook passed to the ICommand::OnCreate event. The ActiveView is returned regardless of whether the hook is a MapControl, PageLayoutControl, ToolbarControl (with a 'buddy' MapControl or PageLayoutControl) or ArcMap.

Product Availability

Available with ArcGIS Engine.

Returns:
A reference to a com.esri.arcgis.carto.IActiveView
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPageLayout

IPageLayout getPageLayout()
                          throws IOException,
                                 AutomationException
Page layout of hooked control or application.

Description

The PageLayout of the hook passed to the ICommand::OnCreate event. The Pagelayout is returned regardless of whether the hook is a PageLayoutControl, ToolbarControl (with a 'buddy' PageLayoutControl) or ArcMap.

If the hook is a MapControl the property will return nothing as PageLayout objects are not supported.

Product Availability

Available with ArcGIS Engine.

Returns:
A reference to a com.esri.arcgis.carto.IPageLayout
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFocusMap

IMap getFocusMap()
                 throws IOException,
                        AutomationException
Focus map of hooked control or application.

Description

The focus map's Map object of the hook passed to the ICommand::OnCreate event. The FocusMap is returned regardless of whether the hook is a MapControl, PageLayoutControl, ToolbarControl (with a 'buddy' MapControl or PageLayoutControl) or ArcMap.

Product Availability

Available with ArcGIS Engine.

Returns:
A reference to a com.esri.arcgis.carto.IMap
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getOperationStack

IOperationStack getOperationStack()
                                  throws IOException,
                                         AutomationException
Operation stack of hooked control or application used for undo/redo operations.

Description

The IOperationStack of the hook passed to the ICommand::OnCreate event. The OperationStack is returned regardless of whether the hook is a ToolbarControl or ArcMap.

The property will return Nothing if the hook is a MapControl or PageLayoutControl that do not have an associated operation stack. If the hook is a ToolbarControl Nothing will be returned if the OperationStack has not been set into the ToolbarControl. A developer normally sets one ControlsOperationStack object into each IToolbarControl::OperationStack used in an application.

If the IToolbarControl::Buddy, IMapControl2::Map or IPageLayoutControl::PageLayout changes a new ControlsOperationStack object will need passing to the IToolbarControl::OperationStack. Use the following events to do this: IToolbarControlEvents::OnBuddyChanged, IMapControlEvents2::OnMapReplaced, IPageLayoutControlEvents::OnPageLayoutReplaced and IPageLayoutControlEvents::OnFocusMapChanged.

Product Availability

Available with ArcGIS Engine.

Returns:
A reference to a com.esri.arcgis.systemUI.IOperationStack
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.