Udostępnij za pośrednictwem


KnownTypesResolver.TryResolveType Method

Definition

Maps any type to a new xsi:type representation.

public:
 override bool TryResolveType(Type ^ type, Type ^ declaredType, System::Runtime::Serialization::DataContractResolver ^ knownTypeResolver, [Runtime::InteropServices::Out] System::Xml::XmlDictionaryString ^ % typeName, [Runtime::InteropServices::Out] System::Xml::XmlDictionaryString ^ % typeNamespace);
public override bool TryResolveType (Type type, Type declaredType, System.Runtime.Serialization.DataContractResolver knownTypeResolver, out System.Xml.XmlDictionaryString typeName, out System.Xml.XmlDictionaryString typeNamespace);
override this.TryResolveType : Type * Type * System.Runtime.Serialization.DataContractResolver * XmlDictionaryString * XmlDictionaryString -> bool
Public Overrides Function TryResolveType (type As Type, declaredType As Type, knownTypeResolver As DataContractResolver, ByRef typeName As XmlDictionaryString, ByRef typeNamespace As XmlDictionaryString) As Boolean

Parameters

type
Type

The type to map.

declaredType
Type

The type declared in the data contract.

knownTypeResolver
DataContractResolver

The known type resolver.

typeName
XmlDictionaryString

The xsi:type name.

typeNamespace
XmlDictionaryString

The xsi:type namespace.

Returns

true if mapping succeeded; otherwise, false.

Remarks

For information on this method, refer to the DataContractResolver class.

Applies to