Browse Source

Fixed forum-10109: TextEditor.ShowLineNumbers=false removes all DottedLineMargins.

Fixed some typos in AvalonEdit documentation.
"Syntax Highlighting" help: added "ICSharpCode.TextEditor compatibility" and "Programmatically accessing highlighting information" sections.
Update Boo.xshd for Boo 0.9.3.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5378 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
a9f1ff3040
  1. 12
      src/Libraries/AvalonEdit/Documentation/Folding.aml
  2. 1
      src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.content
  3. 103
      src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj
  4. 53
      src/Libraries/AvalonEdit/Documentation/Syntax Highlighting.aml
  5. 4
      src/Libraries/AvalonEdit/Documentation/Text Rendering.aml
  6. 20
      src/Libraries/AvalonEdit/Documentation/Welcome.aml
  7. 4
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Boo.xshd
  8. 2
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs
  9. 9
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs
  10. 22
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/TextFormatterFactory.cs

12
src/Libraries/AvalonEdit/Documentation/Folding.aml

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="440df648-413e-4f42-a28b-6b2b0e9b1084" revisionNumber="1">
<developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
<introduction>
<!--<introduction>
<para>
Introduction for 'Folding'.
</para>
</introduction>
</introduction>-->
<section>
<title>How to use Folding in your application</title>
<content>
@ -19,10 +19,10 @@ @@ -19,10 +19,10 @@
</para>
<para>You could use the relevant classes separately;
but, to make it a bit easier to use, the static
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Folding.FoldingManager.Install</codeEntityReference>
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Folding.FoldingManager.Install(ICSharpCode.AvalonEdit.Editing.TextArea)</codeEntityReference>
method will create and register the necessary parts automatically.</para>
<para>All that's left for you is to regularly call
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Folding.FoldingManager.UpdateFoldings</codeEntityReference>
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Folding.FoldingManager.UpdateFoldings(System.Collections.Generic.IEnumerable{ICSharpCode.AvalonEdit.Folding.NewFolding},System.Int32)</codeEntityReference>
with the list of foldings you want to provide.
You could calculate that list yourself, or you could use a built-in
folding strategy to do it for you.</para>
@ -40,10 +40,10 @@ foldingStrategy.UpdateFoldings(foldingManager, textEditor.Document);</code> @@ -40,10 +40,10 @@ foldingStrategy.UpdateFoldings(foldingManager, textEditor.Document);</code>
<content>
<para>
The FoldingManager maintains a list of foldings. The FoldMargin displays those foldings and provides
the UI for collapsing/expanding.
the UI for collapsing/expanding.</para><para>
Folded foldings cause the FoldingElementGenerator to produce a line element that spans the whole folded
text section, causing the text generation for the visual line that contains the folding start to
continue after the folding end in another line.
continue after the folding end in another line.</para><para>
To ensure scrolling works correctly in the presence of foldings, lines inside folded regions must not
be used as start lines for the visual line generation. This is done by setting the line height of all
such lines to 0. To efficiently set the height on a large number of lines and support reverting to the

1
src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.content

@ -1,7 +1,6 @@ @@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Topics defaultTopic="c52241ea-3eba-4ddf-b463-6349cbff38fd">
<Topic id="c52241ea-3eba-4ddf-b463-6349cbff38fd" visible="True" />
<Topic id="e41769b2-38f7-4605-b1d8-9cd22a50a685" visible="True" />
<Topic id="70c4df51-5ecb-4e24-a574-8c5a84306bd1" visible="True" />
<Topic id="5d1af8a2-fc1b-4a1b-b6c1-f33fb14bec1f" visible="True" />
<Topic id="5b1854b4-884c-4713-b921-b28e96a1b43e" visible="True" />

103
src/Libraries/AvalonEdit/Documentation/ICSharpCode.AvalonEdit.shfbproj

@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
</BuildLogFile>
<FrameworkVersion>3.5</FrameworkVersion>
<HelpTitle>AvalonEdit</HelpTitle>
<CopyrightText>Copyright 2008-2009, Daniel Grunwald</CopyrightText>
<CopyrightText>Copyright 2008-2010, Daniel Grunwald</CopyrightText>
<PresentationStyle>Prototype</PresentationStyle>
<HelpFileVersion>4.0.0.0</HelpFileVersion>
<ComponentConfigurations>
@ -45,31 +45,48 @@ @@ -45,31 +45,48 @@
<copy name="reflection" source="*" target="/document/reference" />
</component>
</ComponentConfig>
<ComponentConfig id="Cached MSDN URL References" enabled="True"><component id="Cached MSDN URL References" type="SandcastleBuilder.Components.CachedResolveReferenceLinksComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll"><cache filename="{@AppDataFolder}Cache\MsdnUrl.cache" /><targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@SDKLinks}" /><targets files="reflection.xml" type="{@ProjectLinks}" /></component></ComponentConfig>
<ComponentConfig id="IntelliSense Component" enabled="True"><component id="IntelliSense Component" type="SandcastleBuilder.Components.IntelliSenseComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll"><!-- Output options (optional)
<ComponentConfig id="Cached MSDN URL References" enabled="True">
<component id="Cached MSDN URL References" type="SandcastleBuilder.Components.CachedResolveReferenceLinksComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<cache filename="{@AppDataFolder}Cache\MsdnUrl.cache" />
<targets base="{@SandcastlePath}Data\Reflection" recurse="true" files="*.xml" type="{@SDKLinks}" />
<targets files="reflection.xml" type="{@ProjectLinks}" />
</component>
</ComponentConfig>
<ComponentConfig id="IntelliSense Component" enabled="True">
<component id="IntelliSense Component" type="SandcastleBuilder.Components.IntelliSenseComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Output options (optional)
Attributes:
Include Namespaces (false by default)
Namespaces filename ("Namespaces" if not specified or empty)
Directory (current folder if not specified or empty) --><output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}" /></component></ComponentConfig>
<ComponentConfig id="Cached Framework Comments Index Data" enabled="True"><component id="Cached Framework Comments Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll"><index name="comments" value="/doc/members/member" key="@name" cache="100">
Directory (current folder if not specified or empty) -->
<output includeNamespaces="false" namespacesFile="Namespaces" folder="{@OutputFolder}" />
</component>
</ComponentConfig>
<ComponentConfig id="Cached Framework Comments Index Data" enabled="True">
<component id="Cached Framework Comments Index Data" type="SandcastleBuilder.Components.CachedCopyFromIndexComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<index name="comments" value="/doc/members/member" key="@name" cache="100">
{@CachedFrameworkCommentList}
{@CommentFileList}
</index><copy name="comments" source="*" target="/document/comments" /></component></ComponentConfig>
<ComponentConfig id="Code Block Component" enabled="True"><component id="Code Block Component" type="SandcastleBuilder.Components.CodeBlockComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Base path for relative filenames in source attributes
</index>
<copy name="comments" source="*" target="/document/comments" />
</component>
</ComponentConfig>
<ComponentConfig id="Code Block Component" enabled="True">
<component id="Code Block Component" type="SandcastleBuilder.Components.CodeBlockComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Base path for relative filenames in source attributes
(optional) -->
<basePath value="{@HtmlEncProjectFolder}" />
<!-- Connect to language filter (optional). If omitted,
<basePath value="{@HtmlEncProjectFolder}" />
<!-- Connect to language filter (optional). If omitted,
language filtering is enabled by default. -->
<languageFilter value="true" />
<!-- Allow missing source files (Optional). If omitted,
<languageFilter value="true" />
<!-- Allow missing source files (Optional). If omitted,
it will generate errors if referenced source files
are missing. -->
<allowMissingSource value="false" />
<!-- Remove region markers from imported code blocks. If omitted,
<allowMissingSource value="false" />
<!-- Remove region markers from imported code blocks. If omitted,
region markers in imported code blocks are left alone. -->
<removeRegionMarkers value="false" />
<!-- Code colorizer options (required).
<removeRegionMarkers value="false" />
<!-- Code colorizer options (required).
Attributes:
Language syntax configuration file (required)
XSLT style file (required)
@ -80,44 +97,48 @@ @@ -80,44 +97,48 @@
Keep XML comment "see" tags within the code (optional)
Tab size override (optional, 0 = Use syntax file setting)
Use language name as default title (optional) -->
<colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" copyImageUrl="../icons/CopyCode.gif" language="cs" numberLines="false" outlining="false" keepSeeTags="false" tabSize="0" defaultTitle="true" />
</component></ComponentConfig>
<ComponentConfig id="Post-transform Component" enabled="True"><component id="Post-transform Component" type="SandcastleBuilder.Components.PostTransformComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Code colorizer files (required).
<colorizer syntaxFile="{@SHFBFolder}Colorizer\highlight.xml" styleFile="{@SHFBFolder}Colorizer\highlight.xsl" copyImageUrl="../icons/CopyCode.gif" language="cs" numberLines="false" outlining="false" keepSeeTags="false" tabSize="0" defaultTitle="true" />
</component>
</ComponentConfig>
<ComponentConfig id="Post-transform Component" enabled="True">
<component id="Post-transform Component" type="SandcastleBuilder.Components.PostTransformComponent" assembly="{@SHFBFolder}SandcastleBuilder.Components.dll">
<!-- Code colorizer files (required).
Attributes:
Stylesheet file (required)
Script file (required)
"Copy" image file (required) -->
<colorizer stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" copyImage="{@SHFBFolder}Colorizer\CopyCode.gif" />
<!-- Base output path for the files (required). This should match
<colorizer stylesheet="{@SHFBFolder}Colorizer\highlight.css" scriptFile="{@SHFBFolder}Colorizer\highlight.js" copyImage="{@SHFBFolder}Colorizer\CopyCode.gif" />
<!-- Base output path for the files (required). This should match
the parent folder of the output path of the HTML files (see
SaveComponent). -->
<outputPath value="Output\" />
<!-- Logo image file (optional). Filename is required. The height,
<outputPath value="Output\" />
<!-- Logo image file (optional). Filename is required. The height,
width, altText, placement, and alignment attributes are
optional. -->
<logoFile filename="" height="0" width="0" altText="" placement="left" alignment="left" />
</component></ComponentConfig></ComponentConfigurations>
<logoFile filename="" height="0" width="0" altText="" placement="left" alignment="left" />
</component>
</ComponentConfig>
</ComponentConfigurations>
<DocumentationSources>
<DocumentationSource sourceFile="..\ICSharpCode.AvalonEdit\ICSharpCode.AvalonEdit.csproj" />
</DocumentationSources>
<NamespaceSummaries>
<NamespaceSummaryItem name="(global)" isDocumented="False" />
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit" isDocumented="True">This is the main AvalonEdit namespace.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.CodeCompletion" isDocumented="True">This namespace contains classes to show the code completion window.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Document" isDocumented="True">This namespace contains the document model.
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit" isDocumented="True">This is the main AvalonEdit namespace.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.CodeCompletion" isDocumented="True">This namespace contains classes to show the code completion window.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Document" isDocumented="True">This namespace contains the document model.
The most important class here is TextDocument, which represents document that can be displayed and edited in the text editor.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Editing" isDocumented="True">This namespace is the home of the TextArea class. It manages user input and handles the caret and the selection.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Folding" isDocumented="True">This namespace contains the folding (code collapsing) implementation.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Highlighting" isDocumented="True">This namespace contains the engine for highlighting text documents (DocumentHighlighter).
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Editing" isDocumented="True">This namespace is the home of the TextArea class. It manages user input and handles the caret and the selection.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Folding" isDocumented="True">This namespace contains the folding (code collapsing) implementation.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Highlighting" isDocumented="True">This namespace contains the engine for highlighting text documents (DocumentHighlighter).
Additionally, the class HighlightingColorizer provides integration of the highlighting engine into the text editor GUI.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Highlighting.Xshd" isDocumented="True">This namespace contains a document model for syntax highlighting definitions (.xshd files).</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Indentation" isDocumented="True">This namespace contains the logic for automatic indentation.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Rendering" isDocumented="True">This namespace contains the text rendering infrastructure.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Utils" isDocumented="True">This namespace contains various utility classes.</NamespaceSummaryItem>
<NamespaceSummaryItem name="XamlGeneratedNamespace" isDocumented="False" />
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Xml" isDocumented="True">This namespace contains an error-tolerant XML parser with support for incremental parsing, only reparsing the changed regions of a TextDocument.</NamespaceSummaryItem>
</NamespaceSummaries>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Highlighting.Xshd" isDocumented="True">This namespace contains a document model for syntax highlighting definitions (.xshd files).</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Indentation" isDocumented="True">This namespace contains the logic for automatic indentation.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Rendering" isDocumented="True">This namespace contains the text rendering infrastructure.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Utils" isDocumented="True">This namespace contains various utility classes.</NamespaceSummaryItem>
<NamespaceSummaryItem name="XamlGeneratedNamespace" isDocumented="False" />
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Xml" isDocumented="True">This namespace contains an error-tolerant XML parser with support for incremental parsing, only reparsing the changed regions of a TextDocument.</NamespaceSummaryItem>
<NamespaceSummaryItem name="ICSharpCode.AvalonEdit.Snippets" isDocumented="True">Snippets perform automatic text insertion. Snippets can be interactive after they were expanded, for example to allow the user to easily replace fields in the expanded snippet.</NamespaceSummaryItem></NamespaceSummaries>
<CleanIntermediates>True</CleanIntermediates>
<SyntaxFilters>Standard</SyntaxFilters>
</PropertyGroup>
@ -155,7 +176,9 @@ Additionally, the class HighlightingColorizer provides integration of the highli @@ -155,7 +176,9 @@ Additionally, the class HighlightingColorizer provides integration of the highli
<ImageId>NamespaceDependencies</ImageId>
<AlternateText>Namespace Dependency Graph</AlternateText>
</Image>
<Content Include="License.html" />
<Content Include="License.html">
<ExcludeFromToc>True</ExcludeFromToc>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Media\" />

53
src/Libraries/AvalonEdit/Documentation/Syntax Highlighting.aml

@ -55,8 +55,8 @@ @@ -55,8 +55,8 @@
they can be nested, allowing highlighting constructs like nested comments or one language
embedded in another.</definition>
<definedTerm>HighlightingRule</definedTerm>
<definition>A highlighting rule is regular expression with a color.
It will matches of the regular expression using that color.</definition>
<definition>A highlighting rule is a regular expression with a color.
It will highlight matches of the regular expression using that color.</definition>
<definedTerm>HighlightingColor</definedTerm>
<definition>A highlighting color isn't just a color: it consists of a foreground
color, font weight and font style.</definition>
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
With most languages, such changes happen only at the start and end of multiline comments.
The highlighting engine exploits this property by storing the list of
span stacks in a special data structure
(<codeEntityReference>T:ICSharpCode.AvalonEdit.Utils.CompressingTreeList{T}</codeEntityReference>).
(<codeEntityReference>T:ICSharpCode.AvalonEdit.Utils.CompressingTreeList`1</codeEntityReference>).
The memory usage of the highlighting engine is linear to the number of span stack changes;
not to the total number of lines.
This allows the highlighting engine to store the span stacks for big code
@ -180,6 +180,53 @@ @@ -180,6 +180,53 @@
</para>
</content>
</section>
<section>
<title>ICSharpCode.TextEditor XML highlighting definitions</title>
<content>
<para>ICSharpCode.TextEditor (the predecessor of AvalonEdit) used
a different version of the XSHD file format.
AvalonEdit detects the difference between the formats using the XML namespace:
The new format uses <codeInline>xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"</codeInline>,
the old format does not use any XML namespace.
</para><para>
AvalonEdit can load .xshd files written in that old format, and even
automatically convert them to the new format. However, not all
constructs of the old file format are supported by AvalonEdit.
</para>
<code language="cs"><![CDATA[// convert from old .xshd format to new format
XshdSyntaxDefinition xshd;
using (XmlTextReader reader = new XmlTextReader("input.xshd")) {
xshd = HighlightingLoader.LoadXshd(reader);
}
using (XmlTextWriter writer = new XmlTextWriter("output.xshd", System.Text.Encoding.UTF8)) {
writer.Formatting = Formatting.Indented;
new SaveXshdVisitor(writer).WriteDefinition(xshd);
}
]]></code>
</content>
</section>
<section>
<title>Programmatically accessing highlighting information</title>
<content>
<para>As described above, the highlighting engine only stores the "span stack"
at the start of each line. This information can be retrieved using the
<codeEntityReference>M:ICSharpCode.AvalonEdit.Highlighting.DocumentHighlighter.GetSpanStack(System.Int32)</codeEntityReference>
method:
<code language="cs"><![CDATA[bool isInComment = documentHighlighter.GetSpanStack(1).Any(
s => s.SpanColor != null && s.SpanColor.Name == "Comment");
// returns true if the end of line 1 (=start of line 2) is inside a multiline comment]]></code>
Spans can be identified using their color. For this purpose, named colors should be used in the syntax definition.
</para>
<para>For more detailed results inside lines, the highlighting algorithm
must be executed for that line:
<code language="cs"><![CDATA[int off = document.GetOffset(7, 22);
HighlightedLine result = documentHighlighter.HighlightLine(document.GetLineByNumber(7));
bool isInComment = result.Sections.Any(
s => s.Offset <= off && s.Offset+s.Length >= off
&& s.Color.Name == "Comment");]]></code>
</para>
</content>
</section>
<relatedTopics>
<codeEntityReference>N:ICSharpCode.AvalonEdit.Highlighting</codeEntityReference>
</relatedTopics>

4
src/Libraries/AvalonEdit/Documentation/Text Rendering.aml

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
class is the heart of AvalonEdit.
It takes care of getting the document onto the screen.</para>
<para>To do this in an extensible way, the TextView uses its own kind of model:
the <codeEntityReference>VisualLine</codeEntityReference>.
the <codeEntityReference>T:ICSharpCode.AvalonEdit.Rendering.VisualLine</codeEntityReference>.
Visual lines are created only for the visible part of the document.</para>
<para>
The rendering process looks like this:
@ -157,7 +157,7 @@ @@ -157,7 +157,7 @@
The text layer also serves as container for any inline UI elements.
</listItem><listItem>Caret layer: renders a blinking caret</listItem></list>
It's also possible to insert new layers into the TextView using the
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Rendering.TextView.InsertLayer</codeEntityReference>
<codeEntityReference qualifyHint="true">M:ICSharpCode.AvalonEdit.Rendering.TextView.InsertLayer(System.Windows.UIElement,ICSharpCode.AvalonEdit.Rendering.KnownLayer,ICSharpCode.AvalonEdit.Rendering.LayerInsertionPosition)</codeEntityReference>
method.
This allows adding custom interactive components to the editor
while being in full control of the Z-Order.

20
src/Libraries/AvalonEdit/Documentation/Welcome.aml

@ -14,10 +14,30 @@ @@ -14,10 +14,30 @@
displayed - so it is much more suitable for a code editor where things like the text color
are not controlled by the user, but instead depend on the text (syntax highlighting).
</para>
<para>
AvalonEdit was written for the SharpDevelop IDE. It replaces our old
Windows Forms-based text editor (ICSharpCode.TextEditor).
</para>
</introduction>
<mediaLink><image xlink:href="WelcomeScreenshot" placement="center"/></mediaLink>
<section>
<title>Usage</title>
<content>
<para>The main class of the editor is <codeEntityReference qualifyHint="true">T:ICSharpCode.AvalonEdit.TextEditor</codeEntityReference>.
You can use it similar to a normal WPF TextBox:</para>
<code language="xml"><![CDATA[
<avalonEdit:TextEditor
xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
Name="textEditor"
SyntaxHighlighting="C#"
FontFamily="Consolas"
FontSize="10pt"/>
]]></code>
</content>
</section>
<section>
<title>System requirements</title>
<content>

4
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Boo.xshd

@ -115,8 +115,8 @@ @@ -115,8 +115,8 @@
<Key word="else"/>
<Key word="elif"/>
<Key word="if"/>
<Key word="given"/>
<Key word="when"/>
<Key word="match"/>
<Key word="case"/>
<Key word="unless"/>
<Key word="otherwise"/>
</KeyWords>

2
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Rendering/VisualLine.cs

@ -63,7 +63,7 @@ namespace ICSharpCode.AvalonEdit.Rendering @@ -63,7 +63,7 @@ namespace ICSharpCode.AvalonEdit.Rendering
public double Height { get; private set; }
/// <summary>
/// Gets the position at which the line is visible.
/// Gets the Y position of the line. This is measured in device-independent pixels relative to the start of the document.
/// </summary>
public double VisualTop { get; internal set; }

9
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/TextEditor.cs

@ -405,8 +405,13 @@ namespace ICSharpCode.AvalonEdit @@ -405,8 +405,13 @@ namespace ICSharpCode.AvalonEdit
leftMargins.Insert(1, DottedLineMargin.Create());
} else {
for (int i = 0; i < leftMargins.Count; i++) {
if (leftMargins[i] is LineNumberMargin || DottedLineMargin.IsDottedLineMargin(leftMargins[i]))
leftMargins.RemoveAt(i--);
if (leftMargins[i] is LineNumberMargin) {
leftMargins.RemoveAt(i);
if (i < leftMargins.Count && DottedLineMargin.IsDottedLineMargin(leftMargins[i])) {
leftMargins.RemoveAt(i);
}
break;
}
}
}
}

22
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Utils/TextFormatterFactory.cs

@ -15,7 +15,9 @@ using System.Windows.Media.TextFormatting; @@ -15,7 +15,9 @@ using System.Windows.Media.TextFormatting;
namespace ICSharpCode.AvalonEdit.Utils
{
// Creates TextFormatter instances that with the correct TextFormattingMode, if running on .NET 4.0.
/// <summary>
/// Creates TextFormatter instances that with the correct TextFormattingMode, if running on .NET 4.0.
/// </summary>
static class TextFormatterFactory
{
readonly static DependencyProperty TextFormattingModeProperty;
@ -29,8 +31,13 @@ namespace ICSharpCode.AvalonEdit.Utils @@ -29,8 +31,13 @@ namespace ICSharpCode.AvalonEdit.Utils
}
}
/// <summary>
/// Creates a <see cref="TextFormatter"/> using the formatting mode used by the specified owner object.
/// </summary>
public static TextFormatter Create(DependencyObject owner)
{
if (owner == null)
throw new ArgumentNullException("owner");
// return TextFormatter.Create(TextOptions.GetTextFormattingMode(this));
if (TextFormattingModeProperty != null) {
object formattingMode = owner.GetValue(TextFormattingModeProperty);
@ -44,12 +51,25 @@ namespace ICSharpCode.AvalonEdit.Utils @@ -44,12 +51,25 @@ namespace ICSharpCode.AvalonEdit.Utils
}
}
/// <summary>
/// Returns whether the specified dependency property affects the text formatter creation.
/// Controls should re-create their text formatter for such property changes.
/// </summary>
public static bool PropertyChangeAffectsTextFormatter(DependencyProperty dp)
{
// return dp == TextOptions.TextFormattingModeProperty;
return dp == TextFormattingModeProperty && TextFormattingModeProperty != null;
}
/// <summary>
/// Creates formatted text.
/// </summary>
/// <param name="element">The owner element. The text formatter setting are read from this element.</param>
/// <param name="text">The text.</param>
/// <param name="typeface">The typeface to use. If this parameter is null, the typeface of the <paramref name="element"/> will be used.</param>
/// <param name="emSize">The font size. If this parameter is null, the font size of the <paramref name="element"/> will be used.</param>
/// <param name="foreground">The foreground color. If this parameter is null, the foreground of the <paramref name="element"/> will be used.</param>
/// <returns>A FormattedText object using the specified settings.</returns>
public static FormattedText CreateFormattedText(FrameworkElement element, string text, Typeface typeface, double? emSize, Brush foreground)
{
if (element == null)

Loading…
Cancel
Save