|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IHookHelper
Provides access to members needed when developing commands to work with the MapControl, PageLayoutControl, ArcMap, and custom controls and applications.
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.
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 |
---|
void setHookByRef(Object ppHook) throws IOException, AutomationException
ppHook
- A reference to another Automation Object (IDispatch) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.Object getHook() throws IOException, AutomationException
The hook that is passed to the ICommand::OnCreate event. The hook is a MapControl, PageLayoutControl, ToolbarControl or ArcMap.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IActiveView getActiveView() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IPageLayout getPageLayout() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IMap getFocusMap() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IOperationStack getOperationStack() throws IOException, AutomationException
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.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |