private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (comboBox1.SelectedIndex >= 0)
     {
         HtmlElement_map map = comboBox1.Items[comboBox1.SelectedIndex] as HtmlElement_map;
         onSelectMap(map);
     }
 }
        private void buttonNewMap_Click(object sender, EventArgs e)
        {
            HtmlElement_map map = _webpage.CreateNewMap();

            if (map != null)
            {
                MessageBox.Show(this, string.Format(CultureInfo.InvariantCulture, "A new map is created and named '{0}'", map.id), "Create map", MessageBoxButtons.OK, MessageBoxIcon.Information);
                int n = comboBox1.Items.Add(map);
                comboBox1.SelectedIndex = n;
            }
        }
 private void onSelectMap(HtmlElement_map map)
 {
     if (map != null && map != _currentMap)
     {
         _currentMap = map;
         if (map.Areas == null)
         {
             List <HtmlElement_area> areas = _webpage.GetAreas(map.id);
             map.SetAreas(areas);
         }
         mapCtrl.ReloadShapes(map.ExportShapes());
     }
 }