protected override void Run(ITextEditor textEditor, RefactoringProvider provider)
		{
			new Snippet {
				Elements = {
					new InlineRefactorSnippetElement(context => CreateProperties.CreateDialog(context), "")
				}
			}.Insert((TextArea)textEditor.GetService(typeof(TextArea)));
		}
		protected override void Run(ITextEditor textEditor, RefactoringProvider provider)
		{
			if (textEditor.SelectionLength > 0) {
				
				MethodExtractorBase extractor = GetCurrentExtractor(textEditor);
				if (extractor != null) {
					if (extractor.Extract()) {
						ExtractMethodForm form = new ExtractMethodForm(extractor.ExtractedMethod, new Func<IOutputAstVisitor>(extractor.GetOutputVisitor));
						
						if (form.ShowDialog() == DialogResult.OK) {
							extractor.ExtractedMethod.Name = form.Text;
							using (textEditor.Document.OpenUndoGroup()) {
								extractor.InsertAfterCurrentMethod();
								extractor.InsertCall();
								textEditor.Language.FormattingStrategy.IndentLines(textEditor, 0, textEditor.Document.TotalNumberOfLines - 1);
							}
							textEditor.Select(textEditor.SelectionStart, 0);
						}
					}
				}
			}
		}
示例#3
0
		protected override void Run(ITextEditor textEditor, RefactoringProvider provider)
		{
			using (var pm = Gui.AsynchronousWaitDialog.ShowWaitDialog("${res:SharpDevelop.Refactoring.RemoveUnusedImports}")) {
				NamespaceRefactoringService.ManageUsings(pm, textEditor.FileName, textEditor.Document, true, true);
			}
		}
示例#4
0
		protected abstract void Run(ITextEditor textEditor, RefactoringProvider provider);
示例#5
0
		protected override void Run(ITextEditor textEditor, RefactoringProvider provider)
		{
			ResolveResult rr = ResolveAtCaret(textEditor);
			if (rr is MixedResolveResult) rr = (rr as MixedResolveResult).PrimaryResult;
			if (rr is TypeResolveResult) {
				Rename((rr as TypeResolveResult).ResolvedClass);
			} else if (rr is MemberResolveResult) {
				Rename((rr as MemberResolveResult).ResolvedMember);
			} else if (rr is MethodGroupResolveResult) {
				Rename((rr as MethodGroupResolveResult).GetMethodIfSingleOverload());
			} else if (rr is LocalResolveResult) {
				RenameLocalVariableCommand.Run(rr as LocalResolveResult);
			} else {
				ShowUnknownSymbolError();
			}
		}
示例#6
0
		protected abstract void Run(TextEditorControl textEditor, RefactoringProvider provider);
示例#7
0
		protected override void Run(TextEditorControl textEditor, RefactoringProvider provider)
		{
			ResolveResult rr = ResolveAtCaret(textEditor);
			if (rr is MixedResolveResult) rr = (rr as MixedResolveResult).PrimaryResult;
			if (rr is TypeResolveResult) {
				IClass c = (rr as TypeResolveResult).ResolvedClass;
				if (c == null) {
					ShowUnknownSymbolError();
				} else if (c.CompilationUnit.FileName == null) {
					ShowNoUserCodeError();
				} else {
					FindReferencesAndRenameHelper.RenameClass(c);
				}
			} else if (rr is MemberResolveResult) {
				Rename((rr as MemberResolveResult).ResolvedMember);
			} else if (rr is MethodResolveResult) {
				Rename((rr as MethodResolveResult).GetMethodIfSingleOverload());
			} else {
				ShowUnknownSymbolError();
			}
		}
示例#8
0
		protected override void Run(TextEditorControl textEditor, RefactoringProvider provider)
		{
			NamespaceRefactoringService.ManageUsings(textEditor.FileName, textEditor.Document, true, true);
		}