共用方式為


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實體

適用於