ProxyDataContractResolver.TryResolveType 方法

定义

在序列化过程中,将实际类型映射到 xsi:type 信息。

public:
 override bool TryResolveType(Type ^ dataContractType, 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 dataContractType, 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 (dataContractType As Type, declaredType As Type, knownTypeResolver As DataContractResolver, ByRef typeName As XmlDictionaryString, ByRef typeNamespace As XmlDictionaryString) As Boolean

参数

dataContractType
Type

持久性未知对象的实际类型。

declaredType
Type

声明的类型。

knownTypeResolver
DataContractResolver

ProxyDataContractResolver 的一个实例。

typeName
XmlDictionaryString

此方法返回时,包含 xsi:type 声明的列表。

typeNamespace
XmlDictionaryString

此方法返回时,包含使用的命名空间的列表。

返回

如果已解析该类型,则为 true;否则为 false

注解

有关详细信息,请参阅: 使用 POCO 实体

适用于