internal static bool IsMscorlibClassName (string className) {
BCLDebug.Assert( c_mscorlibName == Assembly.GetExecutingAssembly().nGetSimpleName(),
"mscorlib name mismatch" );
// If the class name does not look like a fully qualified name, we cannot simply determine if it's
// an mscorlib.dll type so we should return true so the type can be matched with the
// right index in the TokenBasedSet.
int index = className.IndexOf(',');
if (index == -1)
return true;
index = className.LastIndexOf(']');
if (index == -1)
index = 0;
// Search for the string 'mscorlib' in the classname. If we find it, we will conservatively assume it's an mscorlib.dll type and load it.
for (int i = index; i < className.Length; i++) {
if (className[i] == 'm' || className[i] == 'M') {
if (String.Compare(className, i, c_mscorlibName, 0, c_mscorlibName.Length, StringComparison.OrdinalIgnoreCase) == 0)
return true;
}
}
return false;
}