次の方法で共有


SurrogateSelector.GetSurrogate メソッド

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

Public Overridable Function GetSurrogate( _
   ByVal type As Type, _   ByVal context As StreamingContext, _   <Out()> ByRef selector As ISurrogateSelector _) As ISerializationSurrogate Implements ISurrogateSelector.GetSurrogate
[C#]
public virtual ISerializationSurrogate GetSurrogate(Typetype,StreamingContextcontext,   out ISurrogateSelectorselector);
[C++]
public: virtual ISerializationSurrogate* GetSurrogate(Type* type,StreamingContextcontext,   [   Out] ISurrogateSelector** selector);
[JScript]
public function GetSurrogate(
   type : Type,context : StreamingContext,selector : ISurrogateSelector) : ISerializationSurrogate;

パラメータ

  • type
    サロゲートを要求する対象の Type
  • context
    ストリーム コンテキスト。
  • selector
    使用するサロゲート。

戻り値

特定の型のサロゲート。

実装

ISurrogateSelector.GetSurrogate

例外

例外の種類 条件
ArgumentNullException type パラメータが null 参照 (Visual Basic では Nothing) です。
SecurityException 呼び出し元に、必要なアクセス許可がありません。

解説

現在のセレクタがサロゲートを指定できない場合は、そのすべての子オブジェクトを確認してから null 参照 (Visual Basic では Nothing) を返します。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

SurrogateSelector クラス | SurrogateSelector メンバ | System.Runtime.Serialization 名前空間