public static TypeInfo GetTypeInfo(this Type type) { if (type == null) { throw new ArgumentNullException("type"); } IReflectableType type2 = (IReflectableType)type; return((type2 != null) ? type2.GetTypeInfo() : null); }
public sealed override TypeInfo GetTypeInfo(Type type) { RuntimeType runtimeType = type as RuntimeType; if (runtimeType != null) return runtimeType.GetRuntimeTypeInfo(); IReflectableType reflectableType = type as IReflectableType; if (reflectableType != null) return reflectableType.GetTypeInfo(); throw runtimeType.GetReflectionDomain().CreateMissingMetadataException(type); }
public static TypeInfo GetTypeInfo(this Type type) { if (type == null) { throw new ArgumentNullException("type"); } IReflectableType reflectableType = (IReflectableType)type; if (reflectableType == null) { return(null); } return(reflectableType.GetTypeInfo()); }
public static TypeInfo GetTypeInfo(Type type) { if (type == null) { throw new ArgumentNullException(nameof(type)); } IReflectableType reflectableType = type as IReflectableType; if (reflectableType != null) { return(reflectableType.GetTypeInfo()); } return(new TypeDelegator(type)); }
public static TypeInfo GetTypeInfo(this Type type) { IReflectableType reflectableType = type as IReflectableType; if (reflectableType != null) { return(reflectableType.GetTypeInfo()); } if (type == null) { throw new ArgumentNullException(nameof(type)); } // This is bizarre but compatible with the desktop which casts "type" to IReflectableType without checking and // thus, throws an InvalidCastException. object ignore = (IReflectableType)type; Debug.Fail("Did not expect to get here."); throw new InvalidOperationException(); }
//public static Type[] GetGenericArguments(this Type type) //{ // return type.GetTypeInfo().GenericTypeArguments; //} public static TypeInfo GetTypeInfo(this Type type) { IReflectableType reflectableType = (IReflectableType)type; return(reflectableType.GetTypeInfo()); }