diff --git a/samples/AvalonEdit.Sample/App.xaml.cs b/samples/AvalonEdit.Sample/App.xaml.cs
index 7b6750393d..36c332b798 100644
--- a/samples/AvalonEdit.Sample/App.xaml.cs
+++ b/samples/AvalonEdit.Sample/App.xaml.cs
@@ -1,4 +1,22 @@
-using System;
+// Copyright (c) 2009 Daniel Grunwald
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this
+// software and associated documentation files (the "Software"), to deal in the Software
+// without restriction, including without limitation the rights to use, copy, modify, merge,
+// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+// to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or
+// substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+// DEALINGS IN THE SOFTWARE.
+
+using System;
using System.Windows;
using System.Data;
using System.Xml;
diff --git a/samples/AvalonEdit.Sample/AvalonEdit/dependencies.png b/samples/AvalonEdit.Sample/AvalonEdit/dependencies.png
new file mode 100644
index 0000000000..6655f805eb
Binary files /dev/null and b/samples/AvalonEdit.Sample/AvalonEdit/dependencies.png differ
diff --git a/samples/AvalonEdit.Sample/AvalonEdit/screenshot.png b/samples/AvalonEdit.Sample/AvalonEdit/screenshot.png
new file mode 100644
index 0000000000..524f91fd88
Binary files /dev/null and b/samples/AvalonEdit.Sample/AvalonEdit/screenshot.png differ
diff --git a/samples/AvalonEdit.Sample/MyCompletionData.cs b/samples/AvalonEdit.Sample/MyCompletionData.cs
index faee432f28..8295e25c33 100644
--- a/samples/AvalonEdit.Sample/MyCompletionData.cs
+++ b/samples/AvalonEdit.Sample/MyCompletionData.cs
@@ -1,9 +1,20 @@
-//
The latest version of AvalonEdit can be found as part of the SharpDevelop project. +For details on AvalonEdit, please see www.avalonedit.net.
-As you can see in this dependency graph, AvalonEdit consists of a few sub-namespaces that have cleanly separated jobs. Most of the namespaces have a kind of 'main' class.
Here is the visual tree of the TextEditor
control:
-
+
It's important to understand that AvalonEdit is a composite control with the three layers: TextEditor
(main control), TextArea
(editing), TextView
(rendering).
While the main control provides some convenience methods for common tasks, for most advanced features you have to work directly with the inner controls. You can access them using textEditor.TextArea
@@ -188,7 +191,7 @@ It takes care of getting the document onto the screen.
To do this in an extensible way, the TextView
uses its own kind of model: the VisualLine
.
Visual lines are created only for the visible part of the document.
The rendering process looks like this:
-
+
The last step in the pipeline is the conversion to one or more System.Windows.Media.TextFormatting.TextLine
instances. WPF then takes care of the actual text rendering.
The "element generators", "line transformers" and "background renderers" are the extension points; it is possible to add custom implementations of
@@ -331,7 +334,7 @@ especially in languages like C# where sequences of
Here's how you can use it:
- For the sake of completeness, here is the implementation of the //
or ///<
You only have to handle the text entering events to determine when you want to show the window; all the UI is already done for you.
// in the constructor:
+
// in the constructor:
textEditor.TextArea.TextEntering += textEditor_TextArea_TextEntering;
textEditor.TextArea.TextEntered += textEditor_TextArea_TextEntered;
}
@@ -375,7 +378,7 @@ The
CompletionWindow
will actually never have focus - instead, it h
on the text area and passes them through its ListBox
.
This allows selecting entries in the completion list using the keyboard and normal typing in the editor at the same time.
MyCompletionData
class used in the code above:
-/// Implements AvalonEdit ICompletionData interface to provide the entries in the
+
/// Implements AvalonEdit ICompletionData interface to provide the entries in the
/// completion drop down.
public class MyCompletionData : ICompletionData
{