private void MarkerColor_SelectedColorChanged(object sender, EventArgs e) { if (!_settingProperties) { var settings = GetMarkerSettings(); UpdateMarker(MarkerSettings.ChangeColor(settings, MarkerColor.SelectedColor)); } }
private void MarkersGrid_UpdatingCell(object sender, UpdatingCellEventArgs e) { var currentRow = MarkersGrid.CurrentRow; if (currentRow != null && currentRow.RowType == RowType.Record) { var data = currentRow.DataRow as MarkerGridRow; if (data != null) { MarkerSettings settings = data.GetMarkerSettings(); object newValue = e.Value; if (e.Value != null) { switch (e.Column.Key) { case "Enabled": settings = MarkerSettings.ChangeEnabled(settings, (bool)newValue); data.Enabled = (bool)newValue; break; case "Name": // Done in Init/EndCustomEdit break; case "Color": settings = MarkerSettings.ChangeColor(settings, (Color)newValue); data.Color = (Color)newValue; break; case "ExtraColor": settings = MarkerSettings.ChangeExtraColor(settings, (Color)newValue); data.ExtraColor = (Color)newValue; break; case "View": settings = MarkerSettings.ChangeView(settings, (string)newValue); data.View = (string)newValue; break; } } UpdateMarker(data, settings); } } }
private void OnChangeColor(object sender, Color selectedColor) { var marker = GetMarker(); UpdateMarker(MarkerSettings.ChangeColor(marker.Settings, selectedColor)); }