C# Class MapAndPageLayoutSynchApp.ControlsSynchronizer

This class is used to synchronize a given PageLayoutControl and a MapControl. When initialized, the user must pass the reference of these control to the class, bind the control together by calling 'BindControls' which in turn sets a joined Map referenced by both control; and set all the buddy controls joined between these two controls. When alternating between the MapControl and PageLayoutControl, you should activate the visible control and deactivate the other by calling ActivateXXX. This class is limited to a situation where the controls are not simultaneously visible.
Mostrar archivo Open project: Esri/arcobjects-sdk-community-samples Class Usage Examples

Public Methods

Method Description
ActivateMap ( ) : void

Activate the MapControl and deactivate the PagleLayoutControl

ActivatePageLayout ( ) : void

Activate the PagleLayoutControl and deactivate the MapCotrol

AddFrameworkControl ( object control ) : void

by passing the application's toolbars and TOC to the synchronization class, it saves you the management of the buddy control each time the active control changes. This method ads the framework control to an array; once the active control changes, the class iterates through the array and calls SetBuddyControl on each of the stored framework control.

BindControls ( IMapControl3 mapControl, IPageLayoutControl2 pageLayoutControl, bool activateMapFirst ) : void

bind the MapControl and PageLayoutControl together by assigning a new joint focus map

BindControls ( bool activateMapFirst ) : void

bind the MapControl and PageLayoutControl together by assigning a new joint focus map

ControlsSynchronizer ( ) : System

default constructor

ControlsSynchronizer ( IMapControl3 mapControl, IPageLayoutControl2 pageLayoutControl ) : System

class constructor

RemoveFrameworkControl ( object control ) : void

Remove a framework control from the managed list of controls

RemoveFrameworkControlAt ( int index ) : void

Remove a framework control from the managed list of controls by specifying its index in the list

ReplaceMap ( IMap newMap ) : void

given a new map, replaces the PageLayoutControl and the MapControl's focus map

Private Methods

Method Description
SetBuddies ( object buddy ) : void

when the active control changes, the class iterates through the array of the framework controls and calls SetBuddyControl on each of the controls.

Method Details

ActivateMap() public method

Activate the MapControl and deactivate the PagleLayoutControl
public ActivateMap ( ) : void
return void

ActivatePageLayout() public method

Activate the PagleLayoutControl and deactivate the MapCotrol
public ActivatePageLayout ( ) : void
return void

AddFrameworkControl() public method

by passing the application's toolbars and TOC to the synchronization class, it saves you the management of the buddy control each time the active control changes. This method ads the framework control to an array; once the active control changes, the class iterates through the array and calls SetBuddyControl on each of the stored framework control.
public AddFrameworkControl ( object control ) : void
control object
return void

BindControls() public method

bind the MapControl and PageLayoutControl together by assigning a new joint focus map
public BindControls ( IMapControl3 mapControl, IPageLayoutControl2 pageLayoutControl, bool activateMapFirst ) : void
mapControl IMapControl3
pageLayoutControl IPageLayoutControl2
activateMapFirst bool true if the MapControl supposed to be activated first
return void

BindControls() public method

bind the MapControl and PageLayoutControl together by assigning a new joint focus map
public BindControls ( bool activateMapFirst ) : void
activateMapFirst bool true if the MapControl supposed to be activated first
return void

ControlsSynchronizer() public method

default constructor
public ControlsSynchronizer ( ) : System
return System

ControlsSynchronizer() public method

class constructor
public ControlsSynchronizer ( IMapControl3 mapControl, IPageLayoutControl2 pageLayoutControl ) : System
mapControl IMapControl3
pageLayoutControl IPageLayoutControl2
return System

RemoveFrameworkControl() public method

Remove a framework control from the managed list of controls
public RemoveFrameworkControl ( object control ) : void
control object
return void

RemoveFrameworkControlAt() public method

Remove a framework control from the managed list of controls by specifying its index in the list
public RemoveFrameworkControlAt ( int index ) : void
index int
return void

ReplaceMap() public method

given a new map, replaces the PageLayoutControl and the MapControl's focus map
public ReplaceMap ( IMap newMap ) : void
newMap IMap
return void