|
|
@ -10,11 +10,13 @@ using System.Windows; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Controls; |
|
|
|
using System.Windows.Media; |
|
|
|
using System.Windows.Media; |
|
|
|
using System.Xml; |
|
|
|
using System.Xml; |
|
|
|
|
|
|
|
|
|
|
|
using ICSharpCode.AvalonEdit.Editing; |
|
|
|
using ICSharpCode.AvalonEdit.Editing; |
|
|
|
using ICSharpCode.AvalonEdit.Highlighting; |
|
|
|
using ICSharpCode.AvalonEdit.Highlighting; |
|
|
|
using ICSharpCode.AvalonEdit.Highlighting.Xshd; |
|
|
|
using ICSharpCode.AvalonEdit.Highlighting.Xshd; |
|
|
|
using ICSharpCode.AvalonEdit.Rendering; |
|
|
|
using ICSharpCode.AvalonEdit.Rendering; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Bookmarks; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Editor; |
|
|
|
|
|
|
|
using ICSharpCode.SharpDevelop.Editor.AvalonEdit; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
using ICSharpCode.SharpDevelop.Gui; |
|
|
|
|
|
|
|
|
|
|
|
namespace ICSharpCode.AvalonEdit.AddIn.Options |
|
|
|
namespace ICSharpCode.AvalonEdit.AddIn.Options |
|
|
@ -29,9 +31,13 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options |
|
|
|
InitializeComponent(); |
|
|
|
InitializeComponent(); |
|
|
|
textEditor.Document.UndoStack.SizeLimit = 0; |
|
|
|
textEditor.Document.UndoStack.SizeLimit = 0; |
|
|
|
textEditor.Options = CodeEditorOptions.Instance; |
|
|
|
textEditor.Options = CodeEditorOptions.Instance; |
|
|
|
|
|
|
|
bracketHighlighter = new BracketHighlightRenderer(textEditor.TextArea.TextView); |
|
|
|
|
|
|
|
|
|
|
|
CodeEditorOptions.Instance.BindToTextEditor(textEditor); |
|
|
|
CodeEditorOptions.Instance.BindToTextEditor(textEditor); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BracketHighlightRenderer bracketHighlighter; |
|
|
|
|
|
|
|
|
|
|
|
List<CustomizedHighlightingColor> customizationList; |
|
|
|
List<CustomizedHighlightingColor> customizationList; |
|
|
|
|
|
|
|
|
|
|
|
XshdSyntaxDefinition LoadBuiltinXshd(string name) |
|
|
|
XshdSyntaxDefinition LoadBuiltinXshd(string name) |
|
|
@ -132,6 +138,28 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options |
|
|
|
selectedText = new CustomizedHighlightingItem(customizationList, selectedText, language, canSetFont: false); |
|
|
|
selectedText = new CustomizedHighlightingItem(customizationList, selectedText, language, canSetFont: false); |
|
|
|
selectedText.PropertyChanged += item_PropertyChanged; |
|
|
|
selectedText.PropertyChanged += item_PropertyChanged; |
|
|
|
listBox.Items.Add(selectedText); |
|
|
|
listBox.Items.Add(selectedText); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create entry for "Bracket highlight"
|
|
|
|
|
|
|
|
IHighlightingItem bracketHighlight = new SimpleHighlightingItem( |
|
|
|
|
|
|
|
BracketHighlightRenderer.BracketHighlight, |
|
|
|
|
|
|
|
ta => { |
|
|
|
|
|
|
|
ta.Document.Text = "(simple) example"; |
|
|
|
|
|
|
|
XshdSyntaxDefinition xshd = (XshdSyntaxDefinition)languageComboBox.SelectedItem; |
|
|
|
|
|
|
|
if (xshd == null) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
var customizationsForCurrentLanguage = customizationList.Where(c => c.Language == null || c.Language == xshd.Name); |
|
|
|
|
|
|
|
BracketHighlightRenderer.ApplyCustomizationsToRendering(bracketHighlighter, customizationsForCurrentLanguage); |
|
|
|
|
|
|
|
bracketHighlighter.SetHighlight(new BracketSearchResult(0, 1, 7, 1)); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Foreground = Colors.Blue, |
|
|
|
|
|
|
|
Background = Colors.Blue |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
bracketHighlight = new CustomizedHighlightingItem(customizationList, bracketHighlight, null, canSetFont: false); |
|
|
|
|
|
|
|
if (language != null) |
|
|
|
|
|
|
|
selectedText = new CustomizedHighlightingItem(customizationList, bracketHighlight, language, canSetFont: false); |
|
|
|
|
|
|
|
bracketHighlight.PropertyChanged += item_PropertyChanged; |
|
|
|
|
|
|
|
listBox.Items.Add(bracketHighlight); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void item_PropertyChanged(object sender, PropertyChangedEventArgs e) |
|
|
|
void item_PropertyChanged(object sender, PropertyChangedEventArgs e) |
|
|
|