次の方法で共有


SoapFormatter コンストラクタ (ISurrogateSelector, StreamingContext)

指定した ISurrogateSelectorStreamingContext を使用して、SoapFormatter クラスの新しいインスタンスを初期化します。

名前空間: System.Runtime.Serialization.Formatters.Soap
アセンブリ: System.Runtime.Serialization.Formatters.Soap (system.runtime.serialization.formatters.soap.dll 内)

構文

'宣言
Public Sub New ( _
    selector As ISurrogateSelector, _
    context As StreamingContext _
)
'使用
Dim selector As ISurrogateSelector
Dim context As StreamingContext

Dim instance As New SoapFormatter(selector, context)
public SoapFormatter (
    ISurrogateSelector selector,
    StreamingContext context
)
public:
SoapFormatter (
    ISurrogateSelector^ selector, 
    StreamingContext context
)
public SoapFormatter (
    ISurrogateSelector selector, 
    StreamingContext context
)
public function SoapFormatter (
    selector : ISurrogateSelector, 
    context : StreamingContext
)
適用できません。

パラメータ

  • selector
    SoapFormatter の新しいインスタンスで使用する ISurrogateSelector。null 参照 (Visual Basic では Nothing) でもかまいません。
  • context
    シリアル化の転送元および転送先を保持する StreamingContext。context パラメータが null 参照 (Visual Basic では Nothing) の場合、Context は既定で CrossMachine に設定されます。

解説

オブジェクトは、指定した Stream を使用してシリアル化または逆シリアル化されます。

シリアル化処理または逆シリアル化処理では、指定した ISurrogateSelector を使用して、逆シリアル化するオブジェクト型用に登録されているサロゲートを検索します。サロゲートは、特定のクラスのオブジェクトをシリアル化および逆シリアル化するためのヘルパです。既定の ISurrogateSelector では、MarshalByRefObject から派生したオブジェクトをリモート処理の目的でシリアル化することはできません。リモート処理を行う場合は、指定した ISurrogateSelector が、MarshalByRefObject から派生したオブジェクトを、指定したサロゲート セレクタによってシリアル化された ObjRef オブジェクトに置換します。つまり、リモート オブジェクトを使用する場合は、selector パラメータに RemotingSurrogateSelector のインスタンスを設定します。サロゲートが不要な場合は、selector パラメータを null 参照 (Visual Basic では Nothing) に設定します。

プラットフォーム

Windows 98,Windows Server 2000 SP4,Windows CE,Windows Millennium Edition,Windows Mobile for Pocket PC,Windows Mobile for Smartphone,Windows Server 2003,Windows XP Media Center Edition,Windows XP Professional x64 Edition,Windows XP SP2,Windows XP Starter Edition

Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。

バージョン情報

.NET Framework

サポート対象 : 3.0,2.0,1.1,1.0

参照

関連項目

SoapFormatter クラス
SoapFormatter メンバ
System.Runtime.Serialization.Formatters.Soap 名前空間
StreamingContext