ISerializationSurrogateProvider2 接口

定义

提供在导出和导入 XML 架构文档(XSD)期间由 DataContractSerializer 替换另一种类型所需的方法。 此接口基于 ISerializationSurrogateProvider.

public interface class ISerializationSurrogateProvider2 : System::Runtime::Serialization::ISerializationSurrogateProvider
public interface ISerializationSurrogateProvider2 : System.Runtime.Serialization.ISerializationSurrogateProvider
type ISerializationSurrogateProvider2 = interface
    interface ISerializationSurrogateProvider
Public Interface ISerializationSurrogateProvider2
Implements ISerializationSurrogateProvider
实现

注解

这些接口与 ISerializationCodeDomSurrogateProvider 一起替换 .NET Framework 4.8 中的 IDataContractSurrogate 接口。

方法

名称 说明
GetCustomDataToExport(MemberInfo, Type)

在架构导出操作期间,将批注插入到架构中以获取非null 返回值。

GetCustomDataToExport(Type, Type)

在架构导出操作期间,将批注插入到架构中以获取非null 返回值。

GetDeserializedObject(Object, Type)

在反序列化期间,返回一个替代指定对象的对象。

(继承自 ISerializationSurrogateProvider)
GetKnownCustomDataTypes(Collection<Type>)

设置用于自定义数据对象的序列化和反序列化的已知类型的集合。

GetObjectToSerialize(Object, Type)

在序列化期间,返回一个替换指定对象的对象。

(继承自 ISerializationSurrogateProvider)
GetReferencedTypeOnImport(String, String, Object)

在架构导入期间,返回架构引用的类型。

GetSurrogateType(Type)

在序列化、反序列化和架构导入和导出过程中,返回替代指定类型的数据协定类型。

(继承自 ISerializationSurrogateProvider)

适用于