BodyWriter.WriteBodyContents(XmlDictionaryWriter) Yöntem

Tanım

İleti gövdesinin içeriğini yazar.Writes out the contents of the message body.

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)

Parametreler

writer
XmlDictionaryWriter

XmlDictionaryWriterİleti gövdesini yazmak için kullanılır.The XmlDictionaryWriter used to write out the message body.

Özel durumlar

writer, null değeridir.writer is null.

Örnekler

Aşağıdaki örnek yönteminin nasıl çağrılacağını gösterir WriteBodyContents(XmlDictionaryWriter) .The following sample shows how to call the WriteBodyContents(XmlDictionaryWriter) method.

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

Açıklamalar

Çağıran varsayılan uygulama WriteBodyContents(XmlDictionaryWriter) OnWriteBodyContents(XmlDictionaryWriter) , geçersiz kılma OnWriteBodyContents(XmlDictionaryWriter) en iyi uzantı noktasını sağlar.The default implementation of WriteBodyContents(XmlDictionaryWriter) calls OnWriteBodyContents(XmlDictionaryWriter), so overriding OnWriteBodyContents(XmlDictionaryWriter) provides the best point of extension.

Şunlara uygulanır