CodeTypeReference GetCodeTypeReferenceInternal (XmlQualifiedName typeName, bool throwError)
{
if (typeName == null)
throw new ArgumentNullException ("typeName");
switch (typeName.Namespace) {
case XmlSchema.Namespace:
return new CodeTypeReference (KnownTypeCollection.GetPrimitiveTypeFromName (typeName.Name));
case KnownTypeCollection.MSSimpleNamespace:
switch (typeName.Name) {
case "guid":
return new CodeTypeReference (typeof (Guid));
case "duration":
return new CodeTypeReference (typeof (TimeSpan));
}
break;
}
var info = GetTypeInfo (typeName, throwError);
return info != null ? info.ClrType : null;
}