private void AddBaseLayerControl(BaseLayerItem layer) { propertiesPanel.Controls.Clear(); Control ctrl = new Control(); CommonPropertyCtrl commCtrl = new CommonPropertyCtrl(); commCtrl.Dock = DockStyle.Fill; var item = new LayerPropertiesCtrl(layer.Tag, _edSvc); //item.LayerChanged += (s, evt) => { OnResourceChanged(); }; item.LayerChanged += WeakEventHandler.Wrap((s, evt) => OnResourceChanged(), (eh) => item.LayerChanged -= eh); item.Dock = DockStyle.Top; ctrl.Controls.Add(commCtrl); ctrl.Controls.Add(item); ctrl.Dock = DockStyle.Fill; propertiesPanel.Controls.Add(ctrl); commCtrl.SelectedObject = new Maestro.Editors.MapDefinition.MapLayersSectionCtrl.BaseLayerItemDesigner(layer); }
private void AddMultiControl(System.Collections.ObjectModel.ReadOnlyCollection <TreeNodeAdv> nodes) { propertiesPanel.Controls.Clear(); CommonPropertyCtrl commCtrl = new CommonPropertyCtrl(); commCtrl.Dock = DockStyle.Fill; List <object> values = new List <object>(); for (int i = 0; i < nodes.Count; i++) { var bgrp = nodes[i].Tag as BaseLayerGroupItem; var blyr = nodes[i].Tag as BaseLayerItem; if (bgrp != null) { values.Add(new Maestro.Editors.MapDefinition.MapLayersSectionCtrl.BaseGroupItemDesigner(bgrp)); } else if (blyr != null) { values.Add(new Maestro.Editors.MapDefinition.MapLayersSectionCtrl.BaseLayerItemDesigner(blyr)); } } propertiesPanel.Controls.Add(commCtrl); commCtrl.SelectedObjects = values.ToArray(); }