This document is archived and information here might be outdated.  Recommended version.


Making a class extension with your custom feature (ArcObjects .NET 10.4 SDK)

Making a class extension with your custom feature


If you make a custom feature, you will nearly always make a class extension to go with it. In particular, implementing your own interface on the class extension is a good way to integrate your custom feature with class-level events, such as the feature class being opened.
You will normally implement a class extension to go with your custom feature.
There are some interfaces that can be implemented on class extensions that are particularly relevant to custom features. Although they are usually not required, it is worth knowing what these interfaces do.
IFeatureClassCreation is used by the Editor object to determine if a feature can be created with a single mouse click. For example, you may have a polygon feature class but desire to create standard-shaped features from single digitized points. It requires additional logic in the custom feature to create the correct polygon geometry from the point.
IPersistCustomFeaturesExtension is used to write out information about your custom features to a stream, so they can be persisted outside the database. ArcMap checks for this interface if the copy and paste tools are used to place features on the clipboard. Consider the example of annotation (one of ESRI's standard custom features); the text element object that belongs with the annotation feature needs to be saved to the clipboard when the Copy tool is used.


See Also:

About custom features
Tree custom feature example
Custom features versus other solutions
Managing custom features