|
|
|
@ -9,9 +9,10 @@ using System;
@@ -9,9 +9,10 @@ using System;
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
using System.Windows; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
using System.Windows.Input; |
|
|
|
|
using System.Windows.Threading; |
|
|
|
|
|
|
|
|
|
using ICSharpCode.AvalonEdit.Snippets; |
|
|
|
|
using ICSharpCode.Core; |
|
|
|
|
using ICSharpCode.Core.Presentation; |
|
|
|
|
using ICSharpCode.NRefactory.Ast; |
|
|
|
|
using ICSharpCode.SharpDevelop; |
|
|
|
@ -37,9 +38,16 @@ namespace SharpRefactoring.Gui
@@ -37,9 +38,16 @@ namespace SharpRefactoring.Gui
|
|
|
|
|
this.editor = editor; |
|
|
|
|
this.context = context; |
|
|
|
|
|
|
|
|
|
this.classFinderContext = new ClassFinder(ParserService.ParseCurrentViewContent(), editor.Document.Text, editor.Caret.Offset); |
|
|
|
|
this.classFinderContext = new ClassFinder(ParserService.ParseCurrentViewContent(), editor.Document.Text, anchor.Offset); |
|
|
|
|
|
|
|
|
|
this.Background = SystemColors.ControlBrush; |
|
|
|
|
|
|
|
|
|
FocusFirstElement(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected virtual void FocusFirstElement() |
|
|
|
|
{ |
|
|
|
|
Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(delegate { this.MoveFocus(new TraversalRequest(FocusNavigationDirection.First)); })); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
protected abstract string GenerateCode(LanguageProperties language, IClass currentClass); |
|
|
|
@ -55,7 +63,7 @@ namespace SharpRefactoring.Gui
@@ -55,7 +63,7 @@ namespace SharpRefactoring.Gui
|
|
|
|
|
|
|
|
|
|
if (parseInfo != null) { |
|
|
|
|
LanguageProperties language = parseInfo.CompilationUnit.Language; |
|
|
|
|
IClass current = parseInfo.CompilationUnit.GetInnermostClass(editor.Caret.Line, editor.Caret.Column); |
|
|
|
|
IClass current = parseInfo.CompilationUnit.GetInnermostClass(anchor.Line, anchor.Column); |
|
|
|
|
|
|
|
|
|
// Generate code could modify the document.
|
|
|
|
|
// So read anchor.Offset after code generation.
|
|
|
|
|