diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2011-10-21 13:26:26 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2011-10-21 13:26:26 +0400 |
commit | 4b101993370fa375fe0c87c18516a9434dc41c32 (patch) | |
tree | 3e1e8c4c0cfb8ce185ab32091c1c84676b393b42 /main/src/addins/MonoDevelop.Refactoring | |
parent | cfe6b6526897901f2eb34b308a3a4adf1e05658f (diff) |
[Refactoring] Fixed various refactoring bugs.
Diffstat (limited to 'main/src/addins/MonoDevelop.Refactoring')
-rw-r--r-- | main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs index 6e1fff6637..b9e2ebbec7 100644 --- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs +++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs @@ -253,6 +253,29 @@ namespace MonoDevelop.Refactoring ResolveResult resolveResult; object item = GetItem (ctx, doc, out resolveResult); bool added = false; + + var options = new RefactoringOptions () { + Document = doc, + Dom = ctx, + ResolveResult = resolveResult, + SelectedItem = item + }; + + var ciset = new CommandInfoSet (); + ciset.Text = GettextCatalog.GetString ("Refactor"); + foreach (var refactoring in RefactoringService.Refactorings) { + if (refactoring.IsValid (options)) { + CommandInfo info = new CommandInfo (refactoring.GetMenuDescription (options)); + info.AccelKey = refactoring.AccelKey; + ciset.CommandInfos.Add (info, new System.Action (new RefactoringOperationWrapper (refactoring, options).Operation)); + } + } + + if (ciset.CommandInfos.Count > 0) { + ainfo.Add (ciset, null); + added = true; + } + if (IdeApp.ProjectOperations.CanJumpToDeclaration (item as INamedElement)) { var type = item as ICSharpCode.NRefactory.TypeSystem.IType; if (type != null && type.GetDefinition ().GetParts ().Count > 1) { @@ -297,27 +320,6 @@ namespace MonoDevelop.Refactoring // } } - RefactoringOptions options = new RefactoringOptions () { - Document = doc, - Dom = ctx, - ResolveResult = resolveResult, - SelectedItem = item - }; - - var ciset = new CommandInfoSet (); - ciset.Text = GettextCatalog.GetString ("Refactor"); - foreach (var refactoring in RefactoringService.Refactorings) { - if (refactoring.IsValid (options)) { - CommandInfo info = new CommandInfo (refactoring.GetMenuDescription (options)); - info.AccelKey = refactoring.AccelKey; - ciset.CommandInfos.Add (info, new System.Action (new RefactoringOperationWrapper (refactoring, options).Operation)); - } - } - - if (ciset.CommandInfos.Count > 0) { - ainfo.Add (ciset, null); - added = true; - } var resolveMenu = new CommandInfoSet (); |