次の方法で共有


SurrogateSelector.GetSurrogate メソッド

定義

特定の型のサロゲートを返します。

public:
 virtual System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % selector);
public virtual System.Runtime.Serialization.ISerializationSurrogate? GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
[System.Security.SecurityCritical]
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
[<System.Security.SecurityCritical>]
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
Public Overridable Function GetSurrogate (type As Type, context As StreamingContext, ByRef selector As ISurrogateSelector) As ISerializationSurrogate

パラメーター

type
Type

サロゲートを要求する対象の Type

context
StreamingContext

ストリーム コンテキスト。

selector
ISurrogateSelector

使用するサロゲート。

戻り値

特定の型のサロゲート。

実装

属性

例外

type パラメーターが null です。

呼び出し元に、必要なアクセス許可がありません。

注釈

現在のセレクターでサロゲートを指定できない場合は、 を返す前にすべての子オブジェクトが nullチェックされます。

適用対象