BodyWriter.WriteBodyContents(XmlDictionaryWriter) Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Grava o conteúdo do corpo da mensagem.
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)
Parâmetros
- writer
- XmlDictionaryWriter
O XmlDictionaryWriter usado para gravar o corpo da mensagem.
Exceções
writer
é null
.
Exemplos
O exemplo a seguir mostra como chamar o WriteBodyContents(XmlDictionaryWriter) método .
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()
Comentários
A implementação padrão de WriteBodyContents(XmlDictionaryWriter) chamadas OnWriteBodyContents(XmlDictionaryWriter), portanto, OnWriteBodyContents(XmlDictionaryWriter) substituir fornece o melhor ponto de extensão.