SurrogateSelector.AddSurrogate メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SurrogateSelector.AddSurrogate メソッドの意味・解説 

SurrogateSelector.AddSurrogate メソッド

確認済みのサロゲートのリストにサロゲートを追加します。

名前空間: System.Runtime.Serialization
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Overridable Sub AddSurrogate
 ( _
    type As Type, _
    context As StreamingContext, _
    surrogate As ISerializationSurrogate _
)
Dim instance As SurrogateSelector
Dim type As Type
Dim context As StreamingContext
Dim surrogate As ISerializationSurrogate

instance.AddSurrogate(type, context, surrogate)
public virtual void AddSurrogate (
    Type type,
    StreamingContext context,
    ISerializationSurrogate surrogate
)
public:
virtual void AddSurrogate (
    Type^ type, 
    StreamingContext context, 
    ISerializationSurrogate^ surrogate
)
public void AddSurrogate (
    Type type, 
    StreamingContext context, 
    ISerializationSurrogate surrogate
)
public function AddSurrogate (
    type : Type, 
    context : StreamingContext, 
    surrogate : ISerializationSurrogate
)

パラメータ

type

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

context

コンテキスト固有のデータ。

surrogate

この型を呼び出すサロゲート。

例外例外
例外の種類条件

ArgumentNullException

type パラメータまたは surrogate パラメータが null 参照 (Visual Basic では Nothing) です。

ArgumentException

サロゲートが、この型およびこのコンテキストに既に存在します。

使用例使用例

AddSurrogate メソッドを呼び出すコード例を次に示します。このコード例は、SurrogateSelector クラスのトピックで取り上げているコード例の一部分です。

// Create a SurrogateSelector.
SurrogateSelector ss = new SurrogateSelector();

// Tell the SurrogateSelector that Employee objects are serialized and
 deserialized 
// using the EmployeeSerializationSurrogate object.
ss.AddSurrogate(typeof(Employee),
new StreamingContext(StreamingContextStates.All),
new EmployeeSerializationSurrogate());
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SurrogateSelector クラス
SurrogateSelector メンバ
System.Runtime.Serialization 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

SurrogateSelector.AddSurrogate メソッドのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



SurrogateSelector.AddSurrogate メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS