BodyWriter.WriteBodyContents(XmlDictionaryWriter) Methode

Definitie

Hiermee wordt de inhoud van de hoofdtekst van het bericht weggeschreven.

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)

Parameters

writer
XmlDictionaryWriter

De XmlDictionaryWriter tekst die wordt gebruikt om de hoofdtekst van het bericht op te schrijven.

Uitzonderingen

writer is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de WriteBodyContents(XmlDictionaryWriter) methode aanroept.

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()

Opmerkingen

De standaard implementatie van WriteBodyContents(XmlDictionaryWriter) aanroepen OnWriteBodyContents(XmlDictionaryWriter), dus overschrijven OnWriteBodyContents(XmlDictionaryWriter) biedt het beste uitbreidingspunt.

Van toepassing op