Click or drag to resize

IMapRendererRequiredRendermodes Property

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
Specifies at which stages of rendering this renderer should be called.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.87.0.0
Syntax
RenderMode RequiredRendermodes { get; }

Property Value

Type: RenderMode
Remarks

The RenderMode values are a set of flags that specify which stages of rendering a renderer's Render method should be called. For example, before the map draws its labels, it would call all its renderers whose RequiredRendermodes property returned RenderMode.Prelabelling.

A renderer can also be called at multiple stages of the rendering process. This is achieved by using the 'or' operator (|) to specify any additional stages the renderer should be called.

return RenderMode.Prelabelling | RenderMode.Labelling;

Whenever a renderer is used in multiple stages of the rendering process, it is possible to find out which stage the renderer is currently in using the RenderContext.Mode property that is passed in to the Render() method.

Examples
Since this is a breaking change to classes derived from IMapRenderer, existing classes can make use of the code below to implement this new property and will continue functioning normally.
public RenderMode RequiredRendermodes {
    get { return RenderMode.PreLabelling | RenderMode.Labelling | RenderMode.PostLabelling; }
}
In order to make a renderer that renders only after the labelling stage, a class that inherits from IMapRenderer should contain something like this:
public RenderMode RequiredRendermodes {
    get { return RenderMode.Labelling; }
}

public void Render(Graphics graphics, RenderContext rc) {
    if (rc.Mode != RenderMode.Labelling) {
        Debug.Assert(false);
    }
    // Do some stuff
}
See Also