C# Class MapAround.UI.LegendBase

Base class for legend classes.

Contains common methods for managing elements.

显示文件 Open project: gkrsu/maparound.core

Public Methods

Method Description
AddElement ( LegendElement element ) : void

Adds an element to this legend.

AddElementsForLayer ( LayerBase layer, int imagesWidth, int imagesHeight ) : void

Creates legend elements for the specified layer and adds it to this legend.

BuildLegendForMap ( Map map, int imagesWidth, int imagesHeight ) : void

Builds a legend for a layers of a map.

ClearElements ( ) : void

Removes all elements from this legend.

InsertElement ( LegendElement element, int index ) : void

Interts an element to this legend.

Protected Methods

Method Description
CheckCaption ( string caption ) : void

Checks a legend caption.

Implementations should throw an exception if a caption value is impossible.

CheckNewElement ( LegendElement element ) : void

Checks an element.

Implementations should throw an exception if an element may not be added.

Method Details

AddElement() public method

Adds an element to this legend.
public AddElement ( LegendElement element ) : void
element LegendElement An element to add
return void

AddElementsForLayer() public method

Creates legend elements for the specified layer and adds it to this legend.
public AddElementsForLayer ( LayerBase layer, int imagesWidth, int imagesHeight ) : void
layer LayerBase A layer which is used to generate elements
imagesWidth int A value specifying a width of images of the elements
imagesHeight int A value specifying a height of images of the elements
return void

BuildLegendForMap() public method

Builds a legend for a layers of a map.
public BuildLegendForMap ( Map map, int imagesWidth, int imagesHeight ) : void
map Map
imagesWidth int
imagesHeight int
return void

CheckCaption() protected abstract method

Checks a legend caption.

Implementations should throw an exception if a caption value is impossible.

protected abstract CheckCaption ( string caption ) : void
caption string A caption value to check
return void

CheckNewElement() protected abstract method

Checks an element.

Implementations should throw an exception if an element may not be added.

protected abstract CheckNewElement ( LegendElement element ) : void
element LegendElement An element to check
return void

ClearElements() public method

Removes all elements from this legend.
public ClearElements ( ) : void
return void

InsertElement() public method

Interts an element to this legend.
public InsertElement ( LegendElement element, int index ) : void
element LegendElement An element to insert
index int A zero-based index at which insert the element
return void