コード例 #1
0
        private void ResetCompletionBrushColorBox(UIElement colorBox)
        {
            var bindingExpression = BindingOperations.GetBindingExpression((FrameworkElement)colorBox,
                                                                           ColorPicker.SelectedColorProperty);

            if (bindingExpression == null)
            {
                return;
            }

            var propNames = bindingExpression.ParentBinding.Path.Path.Split('.');


            var context = propNames[1];

            if (context == "CompletionWindowItemBrushes")
            {
                var propName = propNames[propNames.Length - 3];

                var deflt =
                    (XmlSolidBrush)
                    DefaultValueInitializer.GetDefaultValue(EditorControlTheme.CompletionWindowItemBrushes,
                                                            propName);

                var property = EditorControlTheme.CompletionWindowItemBrushes.GetType()
                               .GetProperty(propName);

                property.SetValue(EditorControlTheme.CompletionWindowItemBrushes, deflt);
            }
            else
            {
                var propName = propNames[propNames.Length - 2];
                DefaultValueInitializer.SetToDefault(EditorControlTheme, propName);
            }
        }
コード例 #2
0
        private void ResetSelectionColorBox(UIElement colorBox)
        {
            var bindingExpression = BindingOperations.GetBindingExpression((FrameworkElement)colorBox,
                                                                           ColorPicker.SelectedColorProperty);
            var propNames = bindingExpression.ParentBinding.Path.Path.Split('.');

            var propName = propNames[propNames.Length - 2];

            DefaultValueInitializer.SetToDefault(EditorControlTheme, propName);
        }
コード例 #3
0
        private void ResetHighlightingColorBox(UIElement colorBox)
        {
            var bindingExpression = BindingOperations.GetBindingExpression((FrameworkElement)colorBox,
                                                                           ColorPicker.SelectedColorProperty);

            if (bindingExpression == null)
            {
                return;
            }

            var propNames = bindingExpression.ParentBinding.Path.Path.Split('.');

            var propName = propNames[propNames.Length - 2];
            var context  = propNames[1];

            if (context == "HighlightingColors")
            {
                DefaultValueInitializer.SetToDefault(EditorControlTheme.HighlightingColors, propName);
            }
            else
            {
                DefaultValueInitializer.SetToDefault(EditorControlTheme, propName);
            }
        }