diff --git a/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs b/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs index 52f7ec258a..83a43be5ba 100644 --- a/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs +++ b/ICSharpCode.NRefactory/TypeSystem/ExtensionMethods.cs @@ -468,5 +468,19 @@ namespace ICSharpCode.NRefactory.TypeSystem return reference.Resolve (compilation.TypeResolveContext); } #endregion + + + #region IAssembly.GetTypeDefinition(string,string,int) + /// + /// Gets the type definition for a top-level type. + /// + /// This method uses ordinal name comparison, not the compilation's name comparer. + public static ITypeDefinition GetTypeDefinition(this IAssembly assembly, string namespaceName, string name, int typeParameterCount = 0) + { + if (assembly == null) + throw new ArgumentNullException ("assembly"); + return assembly.GetTypeDefinition (new TopLevelTypeName (namespaceName, name, typeParameterCount)); + } + #endregion } }