175 references to UnderlyingType
System.Runtime.Serialization (175)
System\Runtime\Serialization\ClassDataContract.cs (17)
459if (!IsTypeVisible(UnderlyingType)) 466DataContract.GetClrTypeFullName(UnderlyingType)), 482DataContract.GetClrTypeFullName(UnderlyingType)), 496DataContract.GetClrTypeFullName(UnderlyingType)), 510DataContract.GetClrTypeFullName(UnderlyingType), 524DataContract.GetClrTypeFullName(UnderlyingType), 544DataContract.GetClrTypeFullName(UnderlyingType), 553DataContract.GetClrTypeFullName(UnderlyingType), 573if (!IsTypeVisible(UnderlyingType)) 580DataContract.GetClrTypeFullName(UnderlyingType)), 596DataContract.GetClrTypeFullName(this.UnderlyingType), 610DataContract.GetClrTypeFullName(UnderlyingType), 630DataContract.GetClrTypeFullName(UnderlyingType), 639DataContract.GetClrTypeFullName(UnderlyingType), 814DataContract.GetClrTypeFullName(this.BaseContract.UnderlyingType), 1398Type type = UnderlyingType; 1432boundClassContract.StableName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(stableName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(this.UnderlyingType), genericParams)), stableName.Namespace);
System\Runtime\Serialization\CodeExporter.cs (2)
291throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(dataContract.GetType()), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 356return GetCodeTypeReference(dataContract.UnderlyingType);
System\Runtime\Serialization\CollectionDataContract.cs (12)
456if (this.UnderlyingType.IsInterface && (this.Kind == CollectionKind.Enumerable || this.Kind == CollectionKind.Collection || this.Kind == CollectionKind.GenericEnumerable)) 458throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.UnderlyingType)))); 1247boundCollectionContract.StableName = CreateQualifiedName(DataContract.ExpandGenericParameters(XmlConvert.DecodeName(this.StableName.Name), new GenericNameProvider(DataContract.GetClrTypeFullName(this.UnderlyingType), paramContracts)), 1248IsCollectionDataContract(UnderlyingType) ? this.StableName.Namespace : DataContract.GetCollectionNamespace(boundCollectionContract.ItemContract.StableName.Namespace)); 1257DataContract.ThrowTypeNotSerializable(UnderlyingType); 1287throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.CollectionTypeDoesNotHaveDefaultCtor, DataContract.GetClrTypeFullName(this.UnderlyingType)))); 1308if (!IsTypeVisible(UnderlyingType)) 1315DataContract.GetClrTypeFullName(UnderlyingType)), 1339DataContract.GetClrTypeFullName(UnderlyingType)), 1351DataContract.GetClrTypeFullName(UnderlyingType), 1367if (!IsTypeVisible(UnderlyingType)) 1374DataContract.GetClrTypeFullName(UnderlyingType)),
System\Runtime\Serialization\DataContract.cs (8)
85throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new SerializationException(SR.GetString(SR.ClassDataContractReturnedForGetOnlyCollection, DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 218throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 223throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.UnexpectedContractType, DataContract.GetClrTypeFullName(this.GetType()), DataContract.GetClrTypeFullName(UnderlyingType)))); 498return (cachedContract != null && cachedContract.UnderlyingType == contract.UnderlyingType); 2249if (alreadyExistingContract.UnderlyingType != DataContractCriticalHelper.GetDataContractAdapterType(type)) 2250throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.DupContractInKnownTypes, type, alreadyExistingContract.UnderlyingType, dataContract.StableName.Namespace, dataContract.StableName.Name))); 2306ThrowInvalidDataContractException(message, UnderlyingType);
System\Runtime\Serialization\DataContractSerializer.cs (3)
365Type declaredType = contract.UnderlyingType; 399throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IsAnyCannotBeSerializedAsDerivedType, graphType, contract.UnderlyingType))); 480if (contract.IsPrimitive && object.ReferenceEquals(contract.UnderlyingType, rootType) /*handle Nullable<T> differently*/)
System\Runtime\Serialization\DataContractSet.cs (10)
104EnsureTypeNotGeneric(dataContract.UnderlyingType); 133if (dataContract.UnderlyingType == null || dataContractInSet.UnderlyingType == null) 137bool typeNamesEqual = (DataContract.GetClrTypeFullName(dataContract.UnderlyingType) == DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)); 138throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.DupTypeContractInDataContractSet, (typeNamesEqual ? dataContract.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContract.UnderlyingType)), (typeNamesEqual ? dataContractInSet.UnderlyingType.AssemblyQualifiedName : DataContract.GetClrTypeFullName(dataContractInSet.UnderlyingType)), dataContract.StableName.Name, dataContract.StableName.Namespace))); 180memberDataContract.UnderlyingType);
System\Runtime\Serialization\EnumDataContract.cs (6)
372throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 378throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnWrite, value, DataContract.GetClrTypeFullName(UnderlyingType)))); 418throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnRead, stringValue, DataContract.GetClrTypeFullName(UnderlyingType)))); 423return Enum.ToObject(UnderlyingType, (ulong)longValue); 424return Enum.ToObject(UnderlyingType, longValue); 437throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.InvalidEnumValueOnRead, value.Substring(index, count), DataContract.GetClrTypeFullName(UnderlyingType))));
System\Runtime\Serialization\Json\DataContractJsonSerializer.cs (3)
427if (contract.IsPrimitive && object.ReferenceEquals(contract.UnderlyingType, rootType))// handle Nullable<T> differently 456Type declaredType = contract.UnderlyingType; 590DataContract.GetClrTypeFullName(dataContract.UnderlyingType),
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
174DataContract.GetClrTypeFullName(traditionalClassDataContract.UnderlyingType), traditionalClassDataContract.MemberNames[i].Value)));
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (2)
68if (this.TraditionalDataContract.UnderlyingType.IsInterface && (kind == CollectionKind.Enumerable || kind == CollectionKind.Collection || kind == CollectionKind.GenericEnumerable)) 70throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidDataContractException(SR.GetString(SR.GetOnlyCollectionMustHaveAddMethod, DataContract.GetClrTypeFullName(this.TraditionalDataContract.UnderlyingType))));
System\Runtime\Serialization\Json\JsonDataContract.cs (3)
187int id = JsonDataContractCriticalHelper.GetId(traditionalDataContract.UnderlyingType.TypeHandle); 263traditionalDataContract.UnderlyingType == Globals.TypeOfXmlQualifiedName) 291SR.GetString(SR.JsonTypeNotSupportedByDataContractJsonSerializer, traditionalDataContract.UnderlyingType));
System\Runtime\Serialization\Json\JsonEnumDataContract.cs (2)
39enumValue = Enum.ToObject(TraditionalDataContract.UnderlyingType, jsonReader.ReadElementContentAsUnsignedLong()); 43enumValue = Enum.ToObject(TraditionalDataContract.UnderlyingType, jsonReader.ReadElementContentAsLong());
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (16)
43TD.DCJsonGenReaderStart("Class", classContract.UnderlyingType.FullName); 90TD.DCJsonGenReaderStart("GetOnlyCollection", collectionContract.UnderlyingType.FullName); 148if (Globals.TypeOfIDeserializationCallback.IsAssignableFrom(classContract.UnderlyingType)) 158if (classContract.UnderlyingType == Globals.TypeOfDateTimeOffsetAdapter) 264Type type = objectType = classContract.UnderlyingType; 270if (classContract.UnderlyingType == Globals.TypeOfDBNull) 326return Globals.TypeOfIObjectReference.IsAssignableFrom(classContract.UnderlyingType); 371BitFlagsGenerator expectedElements = new BitFlagsGenerator(memberCount, ilg, classContract.UnderlyingType.Name + "_ExpectedElements"); 507ConstructorInfo ctor = classContract.UnderlyingType.GetConstructor(Globals.ScanAllMembers, null, JsonFormatGeneratorStatics.SerInfoCtorArgs, null); 509throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.SerializationInfo_ConstructorNotFound, DataContract.GetClrTypeFullName(classContract.UnderlyingType)))); 512ilg.Call(contextArg, XmlFormatGeneratorStatics.ReadSerializationInfoMethod, xmlReaderArg, classContract.UnderlyingType); 530if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 569if (primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) 643Type type = collectionContract.UnderlyingType; 802DataContract.GetClrTypeFullName(collectionContract.UnderlyingType), 859Type type = collectionContract.UnderlyingType;
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (8)
37TD.DCJsonGenWriterStart("Class", classContract.UnderlyingType.FullName); 59TD.DCJsonGenWriterStart("Collection", collectionContract.UnderlyingType.FullName); 108InitArgs(classContract.UnderlyingType); 139InitArgs(collectionContract.UnderlyingType); 330ilg.Call(null, XmlFormatGeneratorStatics.ThrowRequiredMemberMustBeEmittedMethod, member.Name, classContract.UnderlyingType); 364if (!TryWritePrimitiveArray(collectionContract.UnderlyingType, itemType, objectLocal, itemName)) 551if (primitiveContract == null || primitiveContract.UnderlyingType == Globals.TypeOfObject) 693if (primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject)
System\Runtime\Serialization\Json\JsonXmlDataContract.cs (2)
23DataContractSerializer dataContractSerializer = new DataContractSerializer(TraditionalDataContract.UnderlyingType, 75knownTypesList.Add(pair.Value.UnderlyingType);
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (9)
122(contract.UnderlyingType != Globals.TypeOfObjectArray) && 142if (declaredContract.UnderlyingType == typeof(Enum)) 145(SR.GetString(SR.EnumTypeNotSupportedByDataContractJsonSerializer, declaredContract.UnderlyingType))); 185oldItemContract.UnderlyingType.IsGenericType && 186(oldItemContract.UnderlyingType.GetGenericTypeDefinition() == Globals.TypeOfKeyValue)) 188return DataContract.GetDataContract(oldItemContract.UnderlyingType); 303if ((declaredType != dataContract.UnderlyingType) && (dataContract is CollectionDataContract)) 328Type declaredType = rootTypeDataContract.UnderlyingType; 356throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.StableName.Name, dataContract.StableName.Namespace)));
System\Runtime\Serialization\NetDataContractSerializer.cs (3)
248throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.IsAnyNotSupportedByNetDataContractSerializer, contract.UnderlyingType))); 257if (contract.UnderlyingType != graphType) 463if (currentCachedDataContract.UnderlyingType.TypeHandle.Equals(typeHandle))
System\Runtime\Serialization\PrimitiveDataContract.cs (6)
80if (UnderlyingType.IsValueType) 81helper.XmlFormatWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, null, new Type[] { UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) }, null); 83helper.XmlFormatWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, null, new Type[] { typeof(XmlWriterDelegator), UnderlyingType, typeof(XmlDictionaryString), typeof(XmlDictionaryString) }, null); 98if (UnderlyingType.IsValueType) 99helper.XmlFormatContentWriterMethod = typeof(XmlWriterDelegator).GetMethod(WriteMethodName, Globals.ScanAllMembers, null, new Type[] { UnderlyingType }, null); 101helper.XmlFormatContentWriterMethod = typeof(XmlObjectSerializerWriteContext).GetMethod(WriteMethodName, Globals.ScanAllMembers, null, new Type[] { typeof(XmlWriterDelegator), UnderlyingType }, null);
System\Runtime\Serialization\SchemaExporter.cs (8)
131if (classDataContract.UnderlyingType.IsGenericType) 132genericInfoElement = ExportGenericInfo(classDataContract.UnderlyingType, Globals.GenericTypeLocalName, Globals.SerializationNamespace); 366if (collectionDataContract.UnderlyingType.IsGenericType && CollectionDataContract.IsCollectionDataContract(collectionDataContract.UnderlyingType)) 367genericInfoElement = ExportGenericInfo(collectionDataContract.UnderlyingType, Globals.GenericTypeLocalName, Globals.SerializationNamespace); 465if (dataContract.UnderlyingType.IsGenericType) 466genericInfoElement = ExportGenericInfo(dataContract.UnderlyingType, Globals.GenericTypeLocalName, Globals.SerializationNamespace); 504Type clrType = dataContract.UnderlyingType;
System\Runtime\Serialization\SchemaImporter.cs (1)
209return dataContract is PrimitiveDataContract && ((PrimitiveDataContract)dataContract).UnderlyingType == Globals.TypeOfObject;
System\Runtime\Serialization\SurrogateDataContract.cs (3)
41SerializationInfo serInfo = new SerializationInfo(UnderlyingType, XmlObjectSerializer.FormatterConverter, !context.UnsafeTypeForwardingEnabled); 43context.WriteSerializationInfo(xmlWriter, UnderlyingType, serInfo); 85Type objType = UnderlyingType;
System\Runtime\Serialization\XmlDataContract.cs (8)
171return UnderlyingType == Globals.TypeOfXmlElement || UnderlyingType == Globals.TypeOfXmlNodeArray; 311Type type = UnderlyingType; 340Type type = this.UnderlyingType; 369ilg.ConvertValue(this.UnderlyingType, Globals.TypeOfIXmlSerializable); 379if (!IsTypeVisible(UnderlyingType)) 384new SecurityException(SR.GetString(SR.PartialTrustIXmlSerializableTypeNotPublic, DataContract.GetClrTypeFullName(UnderlyingType)), 395new SecurityException(SR.GetString(SR.PartialTrustIXmlSerialzableNoPublicConstructor, DataContract.GetClrTypeFullName(UnderlyingType)),
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (13)
48TD.DCGenReaderStart("Class", classContract.UnderlyingType.FullName); 70TD.DCGenReaderStart("Collection", collectionContract.UnderlyingType.FullName); 92TD.DCGenReaderStart("GetOnlyCollection", collectionContract.UnderlyingType.FullName); 158if (Globals.TypeOfIDeserializationCallback.IsAssignableFrom(classContract.UnderlyingType)) 169if (classContract.UnderlyingType == Globals.TypeOfDateTimeOffsetAdapter) 257Type type = objectType = classContract.UnderlyingType; 263if (classContract.UnderlyingType == Globals.TypeOfDBNull) 319return Globals.TypeOfIObjectReference.IsAssignableFrom(classContract.UnderlyingType); 468ilg.Call(contextArg, XmlFormatGeneratorStatics.ReadSerializationInfoMethod, xmlReaderArg, classContract.UnderlyingType); 486if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 525if (primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) 598Type type = collectionContract.UnderlyingType; 737Type type = collectionContract.UnderlyingType;
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (8)
47TD.DCGenWriterStart("Class", classContract.UnderlyingType.FullName); 69TD.DCGenWriterStart("Collection", collectionContract.UnderlyingType.FullName); 121InitArgs(classContract.UnderlyingType); 151InitArgs(collectionContract.UnderlyingType); 353ilg.Call(null, XmlFormatGeneratorStatics.ThrowRequiredMemberMustBeEmittedMethod, member.Name, classContract.UnderlyingType); 401if (!TryWritePrimitiveArray(collectionContract.UnderlyingType, itemType, objectLocal, itemName, itemNamespace)) 543if (primitiveContract == null || primitiveContract.UnderlyingType == Globals.TypeOfObject) 670if (primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject && !writeXsiType)
System\Runtime\Serialization\XmlObjectSerializerContext.cs (3)
273return knownContract != null && knownContract.UnderlyingType == dataContract.UnderlyingType; 336&& !memberTypeContract.UnderlyingType.IsInterface
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (7)
173if (TryHandleNullOrRef(reader, dataContract.UnderlyingType, name, ns, ref retObj)) 208throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.FactoryTypeNotISerializable, DataContract.GetClrTypeFullName(factoryDataContract.UnderlyingType), DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 542if (xmlDataContract.UnderlyingType == Globals.TypeOfXmlElement) 549else if (xmlDataContract.UnderlyingType == Globals.TypeOfXmlNodeArray) 687dataNode = ReadUnknownPrimitiveData(xmlReader, dataContract.UnderlyingType, dataContractName, dataContractNamespace); 692dataNode = new DataNode<object>(xmlReader.ReadElementContentAsAnyType(dataContract.UnderlyingType));
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (4)
80DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 101DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 201if (this.IsGetOnlyCollection && dataContract.UnderlyingType != declaredType) 209object obj = DataContractSurrogateCaller.GetDeserializedObject(dataContractSurrogate, oldObj, dataContract.UnderlyingType, declaredType);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (1)
263throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlObjectSerializer.CreateSerializationException(SR.GetString(SR.DcTypeNotFoundOnSerialize, DataContract.GetClrTypeFullName(dataContract.UnderlyingType), dataContract.StableName.Name, dataContract.StableName.Namespace)));
System\Runtime\Serialization\XmlObjectSerializerWriteContextComplex.cs (3)
76DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 97DataContract.GetClrTypeFullName(dataContract.UnderlyingType)))); 118DataContract.GetClrTypeFullName(dataContract.UnderlyingType))));
System\Runtime\Serialization\XsdDataContractExporter.cs (3)
194DataContractSet.EnsureTypeNotGeneric(dataContract.UnderlyingType); 207DataContractSet.EnsureTypeNotGeneric(dataContract.UnderlyingType); 220DataContractSet.EnsureTypeNotGeneric(dataContract.UnderlyingType);