From c81d193164f97851446b0e17e9b10afab5e7abd7 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sun, 17 Jul 2011 13:47:48 +0200 Subject: [PATCH] Add strong-name to NRefactory; small API changes for ICSharpCode.Editor. --- .../ICSharpCode.Editor.csproj | 4 +- .../ICSharpCode.Editor/IDocument.cs | 53 +++++++++--------- .../Properties/AssemblyInfo.cs | 2 + .../ICSharpCode.Editor/ReadOnlyDocument.cs | 12 ++-- .../NRefactory/ICSharpCode.NRefactory.snk | Bin 0 -> 596 bytes .../ICSharpCode.NRefactory.csproj | 8 +-- 6 files changed, 42 insertions(+), 37 deletions(-) create mode 100644 src/Libraries/NRefactory/ICSharpCode.NRefactory.snk diff --git a/src/Libraries/NRefactory/ICSharpCode.Editor/ICSharpCode.Editor.csproj b/src/Libraries/NRefactory/ICSharpCode.Editor/ICSharpCode.Editor.csproj index f3baf10f7b..f1a8ec8a87 100644 --- a/src/Libraries/NRefactory/ICSharpCode.Editor/ICSharpCode.Editor.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.Editor/ICSharpCode.Editor.csproj @@ -10,7 +10,7 @@ v4.0 Client Properties - False + True False OnBuildSuccess bin\Debug\ICSharpCode.Editor.xml @@ -19,6 +19,8 @@ 4 false False + ..\ICSharpCode.NRefactory.snk + File x86 diff --git a/src/Libraries/NRefactory/ICSharpCode.Editor/IDocument.cs b/src/Libraries/NRefactory/ICSharpCode.Editor/IDocument.cs index 925eaee669..71cc6f8acc 100644 --- a/src/Libraries/NRefactory/ICSharpCode.Editor/IDocument.cs +++ b/src/Libraries/NRefactory/ICSharpCode.Editor/IDocument.cs @@ -10,7 +10,7 @@ namespace ICSharpCode.Editor /// Line and column counting starts at 1. /// Offset counting starts at 0. /// - public interface IDocument : ITextSource, IServiceProvider + public interface IDocument : ITextSource { /// /// Gets/Sets the text of the whole document.. @@ -18,20 +18,41 @@ namespace ICSharpCode.Editor new string Text { get; set; } // hides TextBuffer.Text to add the setter /// - /// Is raised when the Text property changes. + /// This event is called directly before a change is applied to the document. + /// + /// + /// It is invalid to modify the document within this event handler. + /// Aborting the change (by throwing an exception) is likely to cause corruption of data structures + /// that listen to the Changing and Changed events. + /// + event EventHandler TextChanging; + + /// + /// This event is called directly after a change is applied to the document. + /// + /// + /// It is invalid to modify the document within this event handler. + /// Aborting the event handler (by throwing an exception) is likely to cause corruption of data structures + /// that listen to the Changing and Changed events. + /// + event EventHandler TextChanged; + + /// + /// This event is called after a group of changes is completed. /// - event EventHandler TextChanged; + /// + event EventHandler ChangeCompleted; /// - /// Gets the total number of lines in the document. + /// Gets the number of lines in the document. /// - int TotalNumberOfLines { get; } + int LineCount { get; } /// /// Gets the document line with the specified number. /// /// The number of the line to retrieve. The first line has number 1. - IDocumentLine GetLine(int lineNumber); + IDocumentLine GetLineByNumber(int lineNumber); /// /// Gets the document line that contains the specified offset. @@ -117,25 +138,5 @@ namespace ICSharpCode.Editor /// /// ITextAnchor CreateAnchor(int offset); - - /// - /// This event is called directly before a change is applied to the document. - /// - /// - /// It is invalid to modify the document within this event handler. - /// Aborting the change (by throwing an exception) is likely to cause corruption of data structures - /// that listen to the Changing and Changed events. - /// - event EventHandler Changing; - - /// - /// This event is called directly after a change is applied to the document. - /// - /// - /// It is invalid to modify the document within this event handler. - /// Aborting the event handler (by throwing an exception) is likely to cause corruption of data structures - /// that listen to the Changing and Changed events. - /// - event EventHandler Changed; } } diff --git a/src/Libraries/NRefactory/ICSharpCode.Editor/Properties/AssemblyInfo.cs b/src/Libraries/NRefactory/ICSharpCode.Editor/Properties/AssemblyInfo.cs index 7d06f87441..abb12cbf6c 100644 --- a/src/Libraries/NRefactory/ICSharpCode.Editor/Properties/AssemblyInfo.cs +++ b/src/Libraries/NRefactory/ICSharpCode.Editor/Properties/AssemblyInfo.cs @@ -29,3 +29,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can use the default the Revision and // Build Numbers by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] + +[assembly: CLSCompliant(true)] diff --git a/src/Libraries/NRefactory/ICSharpCode.Editor/ReadOnlyDocument.cs b/src/Libraries/NRefactory/ICSharpCode.Editor/ReadOnlyDocument.cs index d175cea82a..2cdb7556ac 100644 --- a/src/Libraries/NRefactory/ICSharpCode.Editor/ReadOnlyDocument.cs +++ b/src/Libraries/NRefactory/ICSharpCode.Editor/ReadOnlyDocument.cs @@ -48,7 +48,7 @@ namespace ICSharpCode.Editor } /// - public IDocumentLine GetLine(int lineNumber) + public IDocumentLine GetLineByNumber(int lineNumber) { if (lineNumber < 1 || lineNumber > lines.Length) throw new ArgumentOutOfRangeException("lineNumber", lineNumber, "Value must be between 1 and " + lines.Length); @@ -121,7 +121,7 @@ namespace ICSharpCode.Editor /// public IDocumentLine GetLineByOffset(int offset) { - return GetLine(GetLineNumberForOffset(offset)); + return GetLineByNumber(GetLineNumberForOffset(offset)); } int GetLineNumberForOffset(int offset) @@ -168,7 +168,7 @@ namespace ICSharpCode.Editor } /// - public int TotalNumberOfLines { + public int LineCount { get { return lines.Length; } } @@ -181,11 +181,11 @@ namespace ICSharpCode.Editor get { return textSource.TextLength; } } - event EventHandler IDocument.Changing { add {} remove {} } + event EventHandler IDocument.TextChanging { add {} remove {} } - event EventHandler IDocument.Changed { add {} remove {} } + event EventHandler IDocument.TextChanged { add {} remove {} } - event EventHandler IDocument.TextChanged { add {} remove {} } + event EventHandler IDocument.ChangeCompleted { add {} remove {} } void IDocument.Insert(int offset, string text) { diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory.snk b/src/Libraries/NRefactory/ICSharpCode.NRefactory.snk new file mode 100644 index 0000000000000000000000000000000000000000..c07767c3cfaa3816d01fa69e33ce039c6a208f16 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096^&pCO-=>qSh-63P3IdC4;f-Y|nG}m`G zDQdg9d+>lTgU_-NdrwqGq8E5CTzq3spW*yqw80%>#k12jMFVFBDQz*3J>2(Dhh4LZ zios3=2?u@CELj5GtTdOJ&HbrO|Zdf z+{#hizS<$8FY$@`qwWHWyPKT8*Ig-vg^R9j8YP1CUd{1Cmb~t26G-?pA4)XYP?c-! ieu4UE7{na^>dNh#i9x~BEL_PgB4dHwc}sKdSZ)dh(;oo< literal 0 HcmV?d00001 diff --git a/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj b/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj index 1fad1819d5..05a7b75d92 100644 --- a/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj +++ b/src/Libraries/NRefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj @@ -17,6 +17,10 @@ 1591,0618 False -Microsoft.Design#CA1026;-Microsoft.Security#CA2104 + True + ..\ICSharpCode.NRefactory.snk + False + File AnyCPU @@ -407,10 +411,6 @@ {D68133BD-1E63-496E-9EDE-4FBDBF77B486} Mono.Cecil - - {F054A788-B591-4561-A8BA-AE745BBEB817} - ICSharpCode.Editor - \ No newline at end of file