This article shows how to add a drop-down list of areas to choose from, so that your visualization control shows that area, using the Ubisense .NET API.

You should know the information in the following article:
Before you start, remember to:
Add the Ubisense references to your application
Add a
Ubisense.UVis.Visualisation named
visualization1 to your WinForm
Add a ToolStrip from the toolbox to your WinForm as shown. Leave its default name
for this example,
toolStrip1:

This is a toolstrip combo box control that shows all the currently available
building areas. Selecting an area from the combo box loads the area into the
associated
Ubisense.UVis.MapModel:
|
Now add the newly created
areas to the toolstrip
that you added:
|
Ubisense.UVis.ToolStripAreaCombo instances have a
public method
SetModel which sets the map
model to use for the available areas. Note that this method will throw an
exception if there is no area to load. Create your map model and apply it to
your visualization, then apply it to the
Ubisense.UVis.ToolStripAreaCombo as follows:
|
You need to handle changes to which
Ubisense.UBuilding.Area is selected in the
combo box as follows:
|
Add the
AreaChanged handler that you defined
in the previous section as follows. Note that you need to add this line before
you call
areas.SetModel if you want the map
to show an area immediately:
|
Now, when you run your application, selecting an area from the combo box will load that area into the visualization control. Remember that there are cases when the list of available areas is changed in another application, which this example does not attempt to handle.