Click or drag to resize

BehaviorAdapter Class

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Class that provides an easy way to override default MapCtrl behavior.
Inheritance Hierarchy
SystemObject
  Telogis.GeoBaseBehaviorAdapter

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.86.0.0
Syntax
public class BehaviorAdapter

The BehaviorAdapter type exposes the following members.

Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events
  NameDescription
Public eventKeyDownEvent
Fired when the MapCtrl encounters a key down event.
Public eventKeyUpEvent
Fired when the MapCtrl encounters a key up event.
Public eventMouseDownEvent
Fired when the MapCtrl encounters a mouse down event.
Public eventMouseLeaveEvent
Fired when the MapCtrl encounters a mouse leave event.
Public eventMouseMoveEvent
Fired when the MapCtrl encounters a mouse move event.
Public eventMouseUpEvent
Fired when the MapCtrl encounters a mouse up event.
Public eventMouseWheelEvent
Fired when the MapCtrl encounters a mouse wheel event.
Top
Remarks

This class provides a number of events that are called when the corresponding event is fired on the MapCtrl. If no handler is defined for the event, the default behavior of the MapCtrl is observed.

It is expected that if you define a handler for key down or mouse down which calls MapCtrl's default behavior, (if defined) your key up or mouse up event will call the default behavior also.

Examples
Below is an example of how to use the BehaviorAdapter on a MapCtrl in a fictional class.
C#
public class MyClass {
    MapCtrl m_MainMap = new MapCtrl();

    //Define a method to perform some action when a key is pressed.
    private void onKeyDown(Object sender, EventArgs e) {

        //do some stuff before key down behavior is invoked...

        //invoke the default behavior if the keys shift and control are not pressed.
        if(!e.Shift && !e.Control) {
            m_MainMap.DefaultMapCtrlBehavior.KeyDown(sender, e);
        }

        //do some more stuff...
    }

    //Add the onKeyDown method to the events performed by the MapCtrl's BehaviorAdapter.
    m_MainMap.CustomMapBehavior.KeyDownEvent += new KeyEventHandler(onKeyDown);
}
See Also