Browse Source

Fixed SD2-1145: Delegates defined outside any class makes refactoring show "Move class to file ''" item.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1876 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 20 years ago
parent
commit
eb0a071dc2
  1. 5
      src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs

5
src/Main/Base/Project/Src/TextEditor/Commands/ClassBookmarkMenuBuilder.cs

@ -49,6 +49,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -49,6 +49,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
if (!FindReferencesAndRenameHelper.IsReadOnly(c)) {
if (c.DeclaringType == null &&
!c.BodyRegion.IsEmpty &&
!c.Name.Equals(Path.GetFileNameWithoutExtension(c.CompilationUnit.FileName),
StringComparison.InvariantCultureIgnoreCase))
{
@ -131,8 +132,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands @@ -131,8 +132,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands
static string ExtractCode(IClass c, DomRegion codeRegion, int indentationLine)
{
ICSharpCode.TextEditor.Document.IDocument doc = GetDocument(c);
if (indentationLine < 0) indentationLine = 0;
if (indentationLine >= doc.TotalNumberOfLines) indentationLine = doc.TotalNumberOfLines - 1;
if (indentationLine < 1) indentationLine = 1;
if (indentationLine >= doc.TotalNumberOfLines) indentationLine = doc.TotalNumberOfLines;
LineSegment segment = doc.GetLineSegment(indentationLine - 1);
string mainLine = doc.GetText(segment);

Loading…
Cancel
Save