From d23a1be3b12390dcc4cb9a1f02579539b5596e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Sat, 26 Jan 2008 22:54:06 +0000 Subject: [PATCH] Fixed IList for types that do not implement IList, but their superclass does. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2930 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Metadata/DebugType.cs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs index 79f4cc037d..d1d9025250 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Metadata/DebugType.cs @@ -164,7 +164,11 @@ namespace Debugger.MetaData return inter; } } - return null; + if (BaseType != null) { + return BaseType.GetInterface(fullName); + } else { + return null; + } } /// Returns generics arguments for a type or an emtpy @@ -472,15 +476,15 @@ namespace Debugger.MetaData /// Returns false if the given type is same as the current type public bool IsSubclassOf(DebugType superType) { - // Does this type implement the interface? - if (superType.IsInterface) { - foreach(DebugType inter in this.Interfaces) { - if (inter == superType) return true; - } - } - DebugType type = this.BaseType; + DebugType type = this; while (type != null) { if (type.Equals(superType)) return true; + if (superType.IsInterface) { + // Does this 'type' implement the interface? + foreach(DebugType inter in type.Interfaces) { + if (inter == superType) return true; + } + } type = type.BaseType; } return false;