Pitney Bowes MapXtreme User Manual
Page 6

Table of Contents
MapXtreme
6
Developer Guide
Chapter 6: Understanding State Management . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
Terminology. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103
What is State Management?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105
Pros and Cons of the InProc Development Model . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
InProc Management: A Walk-Through. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108
Configuring an Application to Use the InProc Development Model . . . . . . . . . . . . . . .109
Using the MapXtreme Template with the InProc Development Model. . . . . . . . . . . . .110
What is Pooling? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .110
Pros and Cons of Pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111
Saving State for Pooled Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .112
Manual State Management: A Walk-Through . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .113
Configuring a Pooled Application to Use Manual State Management . . . . . . . . . . . . .114
Overview of the Thematics Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .115
Application Settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .116
Implementing a StateManager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
Serializing MapXtreme Objects in the Proper Order . . . . . . . . . . . . . . . . . . . . . . . . . .119
Automatically Deserializing MapXtreme Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120
Handling Initial Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120
Handling Subsequent Requests. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121
Chapter 7: Desktop Applications, Controls, Dialogs, and Tools . . . . . . . . . . . 124
Best Practices for Desktop Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
MapXtreme and COM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .125
Sample Applications and Project Templates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
MapInfo.Windows.Controls Namespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .126
Key Controls to Use in Desktop Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
MapControl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128
MapToolStripButtons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129
The MapToolBar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .130
Layer Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .133