Inheritance: System.Runtime.Serialization.DataContract
 private static DataContract CreateDataContract(int id, RuntimeTypeHandle typeHandle, Type type)
 {
     lock (createDataContractLock)
     {
         DataContract dataContract = dataContractCache[id];
         if (dataContract == null)
         {
             if (type == null)
             {
                 type = Type.GetTypeFromHandle(typeHandle);
             }
             type = DataContract.UnwrapNullableType(type);
             type = GetDataContractAdapterType(type);
             dataContract = GetBuiltInDataContract(type);
             if (dataContract == null)
             {
                 if (type.IsArray)
                 {
                     dataContract = new CollectionDataContract(type);
                 }
                 else if (type.IsEnum)
                 {
                     dataContract = new EnumDataContract(type);
                 }
                 else if (type.IsGenericParameter)
                 {
                     dataContract = new GenericParameterDataContract(type);
                 }
                 else if (Globals.TypeOfIXmlSerializable.IsAssignableFrom(type))
                 {
                     dataContract = new XmlDataContract(type);
                 }
                 else
                 {
                     if (type.IsPointer)
                     {
                         type = Globals.TypeOfReflectionPointer;
                     }
                     if (!CollectionDataContract.TryCreate(type, out dataContract))
                     {
                         if ((!type.IsSerializable && !type.IsDefined(Globals.TypeOfDataContractAttribute, false)) && !ClassDataContract.IsNonAttributedTypeValidForSerialization(type))
                         {
                             ThrowInvalidDataContractException(System.Runtime.Serialization.SR.GetString("TypeNotSerializable", new object[] { type }), type);
                         }
                         dataContract = new ClassDataContract(type);
                     }
                 }
             }
         }
         dataContractCache[id] = dataContract;
         return dataContract;
     }
 }