avalonedit

How do I create an AvalonEdit syntax file (.xshd) and embed it into my assembly?

半城伤御伤魂 提交于 2020-07-31 18:31:18
问题 I'm trying to define some custom highlighting rules for AvalonEdit. There doesn't seem to be any documentation for this -- there's some documentation on the file format, but nothing on how to actually load and use the definition once you've created it. The "Syntax highlighting" wiki page (for the old WinForms TextEditor) documents how to load highlighting definitions from a .xshd file on disk, but I'd rather embed it as a resource, the same way AvalonEdit does with its built-in definitions. I

WPF AvalonEdit SQL xhsd request

只愿长相守 提交于 2020-04-07 12:24:09
问题 I've looked on the internet (over and over) and I couldn't find an SQL.vshd file for AvalonEdit, I've used the old format version but it makes the editor bug (it doesn't show anymore at all), So I'm wondering maybe someone has done such a file because I don't want to waste my time doing this if it's been already done. If you could share yours with me that'd be appreciated :) Thanks in advance 回答1: <?xml version="1.0"?> <SyntaxDefinition name="sql" extensions=".sql" xmlns="http://icsharpcode

WPF AvalonEdit SQL xhsd request

偶尔善良 提交于 2020-04-07 12:23:59
问题 I've looked on the internet (over and over) and I couldn't find an SQL.vshd file for AvalonEdit, I've used the old format version but it makes the editor bug (it doesn't show anymore at all), So I'm wondering maybe someone has done such a file because I don't want to waste my time doing this if it's been already done. If you could share yours with me that'd be appreciated :) Thanks in advance 回答1: <?xml version="1.0"?> <SyntaxDefinition name="sql" extensions=".sql" xmlns="http://icsharpcode

AvalonEdit scroll to line

让人想犯罪 __ 提交于 2020-02-24 12:29:29
问题 I am having a lot of trouble getting an AvalonEdit TextEditor to scroll to a specific line. The ScrollTo() behavior is simply to scroll until that line is in the middle of the view. I have tried many different methods found around the internet and SO like getting the offset with double visualTop = textEditor.TextArea.TextView.GetVisualTopByDocumentLine(line); But each has had its own issues. For example, in the above line I was getting exceptions with the TextView.VisualLines . 回答1: I ended

How can I use AvalonEdit to edit XML files

拥有回忆 提交于 2019-12-23 21:52:05
问题 I would like to include an XML editor in my app - similar to VS's XML editor with auto-coloring, etc. AvalonEdit sounds like a great solution. However, AvalonEdit comes with a sample for C# syntax, not XML syntax. Is there a sample for XML syntax somewhere? 回答1: Just use SyntaxHighlighting="XML" in your XAML: xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" ... <StackPanel> <avalonedit:TextEditor SyntaxHighlighting="XML"/> </StackPanel> 回答2: All you have to do is change the

Weird scrollbar UI in hosted WPF composite control

坚强是说给别人听的谎言 提交于 2019-12-22 20:33:12
问题 My windows forms application hosts AvalonEdit (the composite WPF control in question) in one of its forms to cater to its text editing requirements. Here's the code I use: WPFHost = gcnew ElementHost(); TextField = gcnew AvalonEdit::TextEditor(); WPFHost->Dock = DockStyle::Fill; WPFHost->Child = TextField; TextField->Options->AllowScrollBelowDocument = false; TextField->Options->EnableEmailHyperlinks = false; TextField->Options->EnableHyperlinks = true; TextField->Options-

How to fire an event when mouse hover over a specific text in AvalonEdit?

喜你入骨 提交于 2019-12-22 18:32:12
问题 I have an AvalonEdit WPF based application. I want to define a specific behaviour when the user hovers with the mouse over a specific text in the editor, similar to tag_binding with python tkinter . I googled around, and couldn't find any way to do this. How can this be done? 回答1: I found something similar here http://community.sharpdevelop.net/forums/p/9113/25353.aspx The gist seems to be that at this time (2010!) there where no direct way to do it, but the following hint was given. There's

How to fire an event when mouse hover over a specific text in AvalonEdit?

为君一笑 提交于 2019-12-22 18:31:15
问题 I have an AvalonEdit WPF based application. I want to define a specific behaviour when the user hovers with the mouse over a specific text in the editor, similar to tag_binding with python tkinter . I googled around, and couldn't find any way to do this. How can this be done? 回答1: I found something similar here http://community.sharpdevelop.net/forums/p/9113/25353.aspx The gist seems to be that at this time (2010!) there where no direct way to do it, but the following hint was given. There's

How can I add this WPF control into my WinForm?

亡梦爱人 提交于 2019-12-18 10:54:37
问题 I know that I must use an ElementHost to display a WPF control in a WinForm, but as the WPF control is third party software and it only comes with an XML file and a DLL file. The control is AvalonEdit, I added both the ICSharpCode.AvalonEdit.xml and ICSharpCode.AvalonEdit.dll files to my project, and I went to Project -> Add Reference and added the DLL as a reference. Now I can access the ICSharpCode namespace in my code, all of the classes and methods are exposed, but from this point I am

WPF Debugging AvalonEdit binding to Document property

本小妞迷上赌 提交于 2019-12-13 18:19:36
问题 all day long I am sitting and trying to find out why binding to AvalonEdits Document property isn't working. AvalonEdit is an advanced WPF text editor - part of the SharpDevelop project.(it's going to be used in SharpDevelop v4 Mirador). So when I set up a simple project - one TextEditor (that's the AvalonEdits real name in the library) and made a simple class that has one property - Document and it returns a dummy object with some static text the binding is working perfectly. However in real