internal static Type GetType(string value)
        {
            Type type = Type.GetType(value);

            if ((null == type) && ("System.Numerics.BigInteger" == value))
            {
                type = typeof(BigInteger);
            }
            ObjectStorage.VerifyIDynamicMetaObjectProvider(type);
            return(type);
        }
Ejemplo n.º 2
0
        /// <summary>wrapper around Type.GetType</summary>
        /// <param name="value">assembly qualified type name or one of the special known types</param>
        /// <returns>Type or null if not found</returns>
        /// <exception cref="InvalidOperationException">when type implements IDynamicMetaObjectProvider and not IXmlSerializable</exception>
        /// <remarks>
        /// Types like "System.Guid" will load regardless of AssemblyQualifiedName because they are special
        /// Types like "System.Data.SqlTypes.SqlString" will load because they are in the same assembly as this code
        /// Types like "System.Numerics.BigInteger" won't load because they are not special and not same assembly as this code
        /// </remarks>
        internal static Type GetType(string value) {
            Type dataType = Type.GetType(value); // throwOnError=false, ignoreCase=fase
            if (null == dataType) {
                if ("System.Numerics.BigInteger" == value) {
                    dataType = typeof(System.Numerics.BigInteger);
                }
            }

            // Dev10 671061: prevent reading type from schema which implements IDynamicMetaObjectProvider and not IXmlSerializable
            // the check here prevents the type from being loaded in schema or as instance data (when DataType is object)
            ObjectStorage.VerifyIDynamicMetaObjectProvider(dataType);
            return dataType;
        }
Ejemplo n.º 3
0
 /// <summary>wrapper around Type.AssemblyQualifiedName</summary>
 /// <param name="type"></param>
 /// <returns>qualified name when writing in xml</returns>
 /// <exception cref="InvalidOperationException">when type implements IDynamicMetaObjectProvider and not IXmlSerializable</exception>
 internal static string GetQualifiedName(Type type)
 {
     Debug.Assert(null != type, "null type");
     ObjectStorage.VerifyIDynamicMetaObjectProvider(type);
     return(type.AssemblyQualifiedName !);
 }
 internal static string GetQualifiedName(Type type)
 {
     ObjectStorage.VerifyIDynamicMetaObjectProvider(type);
     return(type.AssemblyQualifiedName);
 }