Author: lluis
Date: 2007-02-10 19:14:11 -0500 (Sat, 10 Feb 2007)
New Revision: 72592
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs
Log:
* MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't show the go to
base command if the selected class does not have a base class, or
we can't jump to it.
Modified: trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog
===================================================================
--- trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2007-02-11
00:02:41 UTC (rev 72591)
+++ trunk/monodevelop/Core/src/MonoDevelop.Ide/ChangeLog 2007-02-11
00:14:11 UTC (rev 72592)
@@ -1,3 +1,9 @@
+2007-02-11 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * MonoDevelop.Ide.Commands/RefactoryCommands.cs: Don't show the go to
+ base command if the selected class does not have a base class, or
+ we can't jump to it.
+
2007-02-10 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* MonoDevelop.Ide.Templates/SingleFileDescriptionTemplate.cs: Added
Modified:
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs
===================================================================
---
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs
2007-02-11 00:02:41 UTC (rev 72591)
+++
trunk/monodevelop/Core/src/MonoDevelop.Ide/MonoDevelop.Ide.Commands/RefactoryCommands.cs
2007-02-11 00:14:11 UTC (rev 72592)
@@ -114,7 +114,16 @@
if (item is IClass) {
txt = GettextCatalog.GetString ("Class {0}",
item.Name);
- ciset.CommandInfos.Add
(GettextCatalog.GetString ("Go to base"), new RefactoryOperation
(refactorer.GoToBase));
+ IClass cls = (IClass) item;
+ if (cls.BaseTypes.Count > 0) {
+ foreach (IReturnType rt in
cls.BaseTypes) {
+ IClass bc = ctx.GetClass
(rt.FullyQualifiedName, null, true, true);
+ if (bc != null && bc.ClassType
!= ClassType.Interface && IdeApp.ProjectOperations.CanJumpToDeclaration (bc)) {
+ ciset.CommandInfos.Add
(GettextCatalog.GetString ("Go to base"), new RefactoryOperation
(refactorer.GoToBase));
+ break;
+ }
+ }
+ }
ciset.CommandInfos.Add
(GettextCatalog.GetString ("Find derived classes"), new RefactoryOperation
(refactorer.FindDerivedClasses));
}
else if (item is IField) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches