Ejemplo n.º 1
0
        /// <summary>
        /// The dependency property for has changed.
        /// Chnage the <seealso cref="SolidColorBrush"/> to be used for highlighting the current editor line
        /// in the particular <seealso cref="EdiView"/> control.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnCurrentLineBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            EdiView view = d as EdiView;

            if (view != null && e != null)
            {
                SolidColorBrush newValue = e.NewValue as SolidColorBrush;

                if (newValue != null)
                {
                    view.AdjustCurrentLineBackground(newValue);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="OptionChanged"/> event.
        /// </summary>
        private static void OnOptionsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            EdiView view = d as EdiView;

            if (view != null && e != null)
            {
                TextEditorOptions newValue = e.NewValue as TextEditorOptions;

                if (newValue != null)
                {
                    view.Options = newValue;
                }
            }
        }
Ejemplo n.º 3
0
        private static void OnSyntaxHighlightingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            EdiView view = d as EdiView;

            if (view == null || e == null)
            {
                return;
            }

            IHighlightingDefinition newValue = e.NewValue as IHighlightingDefinition;

            if (newValue != null)
            {
                view.SyntaxHighlighting = newValue;
                view.SetFolding(newValue);
            }
        }