語言

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 一起,這些介面取代了 Framework 4.8 .NET IDataContractSurrogate 介面。

方法

名稱 Description
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)

適用於