BodyWriter.WriteBodyContents(XmlDictionaryWriter) メソッド

定義

メッセージ本文の内容を書き出します。

public:
 void WriteBodyContents(System::Xml::XmlDictionaryWriter ^ writer);
public void WriteBodyContents (System.Xml.XmlDictionaryWriter writer);
member this.WriteBodyContents : System.Xml.XmlDictionaryWriter -> unit
Public Sub WriteBodyContents (writer As XmlDictionaryWriter)

パラメーター

writer
XmlDictionaryWriter

メッセージ本文の書き込みに使用される XmlDictionaryWriter

例外

writernullです。

次のサンプルでは、WriteBodyContents(XmlDictionaryWriter) メソッドを呼び出す方法を示します。

string[] strings = {"Hello", "world"};
MyBodyWriter bw = new MyBodyWriter(strings);

StringBuilder strBuilder = new StringBuilder(10);
XmlWriter writer = XmlWriter.Create(strBuilder);
XmlDictionaryWriter dictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);

bw.WriteBodyContents(dictionaryWriter);
dictionaryWriter.Flush();
Dim strings() As String = {"Hello", "world"}
Dim bw As New MyBodyWriter(strings)

Dim strBuilder As New StringBuilder(10)
Dim writer = XmlWriter.Create(strBuilder)
Dim dictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer)

bw.WriteBodyContents(dictionaryWriter)
dictionaryWriter.Flush()

注釈

WriteBodyContents(XmlDictionaryWriter) の既定の実装では OnWriteBodyContents(XmlDictionaryWriter) が呼び出されるため、OnWriteBodyContents(XmlDictionaryWriter) のオーバーライドにより、最善の機能拡張ポイントが提供されます。

適用対象