Пример #1
0
        private void MarkerActive_CheckedChanged(object sender, EventArgs e)
        {
            MarkerActivePanel.Enabled = MarkerActive.Checked;

            if (!_settingProperties)
            {
                var settings = GetMarkerSettings();
                UpdateMarker(MarkerSettings.ChangeEnabled(settings, MarkerActive.Checked));
            }
        }
Пример #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 OnChangeEnabled(object sender, CommandEventArgs e)
        {
            var marker = GetMarker();

            UpdateMarker(MarkerSettings.ChangeEnabled(marker.Settings, e.Command.IsChecked));
        }