BodyWriter.WriteBodyContents(XmlDictionaryWriter) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
Parameters
- writer
- XmlDictionaryWriter
The XmlDictionaryWriter used to write out the message body.
Exceptions
writer
is null
.
Examples
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()
Remarks
The default implementation of WriteBodyContents(XmlDictionaryWriter) calls OnWriteBodyContents(XmlDictionaryWriter), so overriding OnWriteBodyContents(XmlDictionaryWriter) provides the best point of extension.
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Kommer snart: Under hela 2024 kommer vi att fasa ut GitHub-problem som feedbackmekanism för innehåll och ersätta det med ett nytt feedbacksystem. Mer information finns i:Skicka och visa feedback för