示例#1
0
        public void EraseColorSegment()
        {
            if (CurrentCodeFile == null || AvalonEditor.SelectionLength == 0)
            {
                return;
            }

            CurrentCodeFile.EraseColorSegment(AvalonEditor.SelectionStart, AvalonEditor.SelectionStart + AvalonEditor.SelectionLength);

            // Ставим каретку в начало выделения
            AvalonEditor.SelectionLength = 0;
            Redraw();
        }
示例#2
0
        // ----------------------------------------------------------------------------------------
        public void AddColorSegment(SolidColorBrush color)
        {
            if (CurrentCodeFile == null || AvalonEditor.SelectionLength == 0)
            {
                return;
            }

            // Стираем все, что было на этом месте
            CurrentCodeFile.EraseColorSegment(AvalonEditor.SelectionStart, AvalonEditor.SelectionStart + AvalonEditor.SelectionLength);

            // Рисуем там же новый цвет
            CurrentCodeFile.AddColorSegment(AvalonEditor.SelectionStart, AvalonEditor.SelectionStart + AvalonEditor.SelectionLength, color);

            // Ставим каретку в начало выделения
            AvalonEditor.SelectionLength = 0;
            Redraw();
        }