SurrogateSelector.AddSurrogate 方法

定义

将代理项添加到已检查代理项的列表中。

public:
 virtual void AddSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, System::Runtime::Serialization::ISerializationSurrogate ^ surrogate);
public virtual void AddSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISerializationSurrogate surrogate);
abstract member AddSurrogate : Type * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISerializationSurrogate -> unit
override this.AddSurrogate : Type * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISerializationSurrogate -> unit
Public Overridable Sub AddSurrogate (type As Type, context As StreamingContext, surrogate As ISerializationSurrogate)

参数

type
Type

需要其代理项的 Type

context
StreamingContext

上下文特定的数据。

surrogate
ISerializationSurrogate

要为此类型调用的代理项。

例外

typesurrogate 参数为 null

此类型和上下文的代理项已存在。

适用于