/// <summary> /// Applies the selected options and closes the form /// </summary> private void btnApply_Click(object sender, EventArgs e) { string name; SymbologyType type; if (!get_CurrentNameAndType(out name, out type)) { return; } if (type == SymbologyType.Default) { name = ""; } MapWinGIS.Map map = m_legend.Map; if (map != null) { int handle = m_layer.Handle; string description = ""; if (map.LoadLayerOptions(handle, name, ref description)) { m_legend.Map.Redraw(); m_legend.Refresh(); } else { Globals.MessageBoxError("Error while loading options"); } } }
/// <summary> /// Applies a given set of options to the layer /// </summary> private void btnOk_Click(object sender, EventArgs e) { MapWinGIS.Map map = m_legend.Map; if (map != null) { if (listView1.SelectedItems.Count > 0) { if (listView1.SelectedItems[0].Index > 0) // otherwise that's random options { int row = listView1.SelectedItems[0].Index; string name = listView1.SelectedItems[0].Text; SymbologyType type = (SymbologyType)listView1.SelectedItems[0].Tag; if (type == SymbologyType.Default) { name = ""; } string description = ""; bool res = map.LoadLayerOptions(m_handle, name, ref description); } } } }