diff --git a/ILSpy/Bookmarks/MemberBookmark.cs b/ILSpy/Bookmarks/MemberBookmark.cs index 46a52d3d2..7edd645e9 100644 --- a/ILSpy/Bookmarks/MemberBookmark.cs +++ b/ILSpy/Bookmarks/MemberBookmark.cs @@ -21,6 +21,7 @@ using System.Windows; using System.Windows.Input; using System.Windows.Media; +using ICSharpCode.Decompiler; using ICSharpCode.NRefactory.CSharp; using ICSharpCode.NRefactory.TypeSystem; using Mono.Cecil; @@ -91,9 +92,9 @@ namespace ICSharpCode.ILSpy.Bookmarks public int LineNumber { get { - var t = node.Annotation>(); + var t = node.Annotation(); if (t != null) - return t.Item1; + return t.Line; return 0; } } diff --git a/ILSpy/Languages/Language.cs b/ILSpy/Languages/Language.cs index 3275e54cd..708b0fd3c 100644 --- a/ILSpy/Languages/Language.cs +++ b/ILSpy/Languages/Language.cs @@ -207,7 +207,7 @@ namespace ICSharpCode.ILSpy var nodes = TreeTraversal .PreOrder((AstNode)builder.CompilationUnit, n => n.Children) - .Where(n => n is AttributedNode && n.Annotation>() != null); + .Where(n => n is AttributedNode && n.Annotation() != null); OnDecompilationFinished(new DecompileEventArgs { CodeMappings = builder.CodeMappings, diff --git a/ILSpy/TextView/AvalonEditTextOutput.cs b/ILSpy/TextView/AvalonEditTextOutput.cs index 7b247ddb9..996e182bc 100644 --- a/ILSpy/TextView/AvalonEditTextOutput.cs +++ b/ILSpy/TextView/AvalonEditTextOutput.cs @@ -65,7 +65,7 @@ namespace ICSharpCode.ILSpy.TextView /// public sealed class AvalonEditTextOutput : ISmartTextOutput { - int lineNumber = 1; + TextOutputLocation location = new TextOutputLocation { Line = 1, Column = 1 }; int lastLineStart = 0; readonly StringBuilder b = new StringBuilder(); @@ -117,6 +117,13 @@ namespace ICSharpCode.ILSpy.TextView get { return b.Length; } } + public TextOutputLocation Location { + get { + location.Column = b.Length - lastLineStart + 1; + return location; + } + } + #region Text Document TextDocument textDocument; @@ -188,7 +195,7 @@ namespace ICSharpCode.ILSpy.TextView b.AppendLine(); needsIndent = true; lastLineStart = b.Length; - lineNumber++; + location.Line++; if (this.TextLength > LengthLimit) { throw new OutputLengthExceededException(); } @@ -236,17 +243,5 @@ namespace ICSharpCode.ILSpy.TextView this.UIElements.Add(new KeyValuePair>(this.TextLength, new Lazy(element))); } } - - public int CurrentLine { - get { - return lineNumber; - } - } - - public int CurrentColumn { - get { - return b.Length - lastLineStart + 1; - } - } } }