Tools – Pitney Bowes MapXtreme User Manual
Page 475

Appendix B: Customizing MapXtreme
Customizable Classes
MapXtreme v7.1
482
Developer Guide
display a confirmation prompt, even when the GroupLayer is empty, create a class that derives from
GroupLayerNodeHelper and override the IsRemovalConfirmed method. The code example below
illustrates how this is done.
using System;
using MapInfo.Windows.Controls;
namespace MapInfo.Samples.LayerControl
{
public class CustomLayerNodeHelper : GroupLayerNodeHelper
{
public CustomLayerNodeHelper()
{
}
public override bool IsRemovalConfirmed(object obj)
{
return true;
}
}
}
Then, to use this new helper class in your application, call the LayerControl's SetLayerTypeHelper
method, using syntax such as this:
layerControlDlg.LayerControl.SetLayerTypeHelper(
typeof(GroupLayer), new CustomLayerNodeHelper() );
The subclasses of LayerNodeHelper are:
•
MapNodeHelper
•
MapLayerNodeHelper
•
GroupLayerNodeHelper
•
LabelLayerNodeHelper
•
LabelSourceNodeHelper
•
LabelModifierNodeHelper
•
FeatureStyleModifierNodeHelper
•
RangedThemeNodeHelper
•
DotDensityThemeNodeHelper
•
IndividualValueThemeNodeHelper
•
PieThemeNodeHelper
•
BarThemeNodeHelper
•
GradSymbolThemeNodeHelper
Tools
Tools can be customized in two ways: by sub classing an existing tool or by adding code to a
Custom base tool. See
Chapter 7: Desktop Applications, Controls, Dialogs, and Tools
for more
information desktop tools. See
Chapter 5: Web Applications, Controls, and Tools
for information
on web tools.