/// <summary> /// Changes the style of the selected category /// </summary> private void ChangeCategoryStyle() { var ct = View.SelectedCategory; if (ct == null) { return; } using (var form = _context.GetSymbologyForm(Model.Layer.Handle, ct.Style, true)) { if (form == null) { return; } form.Text = "Category drawing options"; if (_context.View.ShowChildView(form)) { View.InvalidateView(); FireRedraw(); } } }
/// <summary> /// Shows dialog to edit default style for vector layer. If visualization categories exists /// the new values will be applied to them as well. /// </summary> public static bool ShowDefaultStyleDialog(this IAppContext context, int layerHandle, bool applyDisabled, IWin32Window parent) { if (context == null) { throw new ArgumentNullException("context"); } var layer = context.Layers.ItemByHandle(layerHandle); if (layer == null || layer.FeatureSet == null) { throw new ApplicationException("Invalid layer handle."); } var style = layer.FeatureSet.Style; using (var form = context.GetSymbologyForm(layer.Handle, style, applyDisabled)) { form.Text = "Default Layer Style"; if (context.View.ShowChildView(form, parent)) { return(true); } } return(false); }
private void LayerCategoryClicked(IMuteLegend legend, LayerCategoryEventArgs e) { var fs = legend.Map.GetFeatureSet(e.LayerHandle); if (fs != null) { var ct = fs.Categories[e.CategoryIndex]; if (ct != null) { using (var form = _context.GetSymbologyForm(e.LayerHandle, ct.Style, false)) { _context.View.ShowChildView(form); } e.Handled = true; } } }