Mono.CSharp.DocUtil.FindDocumentedTypeNonArray C# (CSharp) Method

FindDocumentedTypeNonArray() private static method

private static FindDocumentedTypeNonArray ( MemberCore mc, string identifier, DeclSpace ds, string cref, Report r ) : System.TypeSpec
mc MemberCore
identifier string
ds DeclSpace
cref string
r Report
return System.TypeSpec
		private static TypeSpec FindDocumentedTypeNonArray (MemberCore mc, 
			string identifier, DeclSpace ds, string cref, Report r)
		{
			switch (identifier) {
			case "int":
				return TypeManager.int32_type;
			case "uint":
				return TypeManager.uint32_type;
			case "short":
				return TypeManager.short_type;;
			case "ushort":
				return TypeManager.ushort_type;
			case "long":
				return TypeManager.int64_type;
			case "ulong":
				return TypeManager.uint64_type;;
			case "float":
				return TypeManager.float_type;;
			case "double":
				return TypeManager.double_type;
			case "char":
				return TypeManager.char_type;;
			case "decimal":
				return TypeManager.decimal_type;;
			case "byte":
				return TypeManager.byte_type;;
			case "sbyte":
				return TypeManager.sbyte_type;;
			case "object":
				return TypeManager.object_type;;
			case "bool":
				return TypeManager.bool_type;;
			case "string":
				return TypeManager.string_type;;
			case "void":
				return TypeManager.void_type;;
			}
			FullNamedExpression e = ds.LookupNamespaceOrType (identifier, 0, mc.Location, false);
			if (e != null) {
				if (!(e is TypeExpr))
					return null;
				return e.Type;
			}
			int index = identifier.LastIndexOf ('.');
			if (index < 0)
				return null;

			var nsName = identifier.Substring (0, index);
			var typeName = identifier.Substring (index + 1);
			Namespace ns = ds.NamespaceEntry.NS.GetNamespace (nsName, false);
			ns = ns ?? mc.Module.GlobalRootNamespace.GetNamespace(nsName, false);
			if (ns != null) {
				var te = ns.LookupType(mc.Compiler, typeName, 0, true, mc.Location);
				if(te != null)
					return te.Type;
			}

			int warn;
			TypeSpec parent = FindDocumentedType (mc, identifier.Substring (0, index), ds, cref, r);
			if (parent == null)
				return null;
			// no need to detect warning 419 here
			var ts = FindDocumentedMember (mc, parent,
				identifier.Substring (index + 1),
				null, ds, out warn, cref, false, null, r) as TypeSpec;
			if (ts != null)
				return ts;
			return null;
		}