private void MarkerExtraColor_SelectedColorChanged(object sender, EventArgs e)
 {
     if (!_settingProperties)
     {
         var settings = GetMarkerSettings();
         UpdateMarker(MarkerSettings.ChangeExtraColor(settings, MarkerExtraColor.SelectedColor));
     }
 }
示例#2
0
        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);
                }
            }
        }
示例#3
0
        private void OnChangeExtraColor(object sender, Color selectedColor)
        {
            var marker = GetMarker();

            UpdateMarker(MarkerSettings.ChangeExtraColor(marker.Settings, selectedColor));
        }