Compartir vía


BodyWriter.WriteBodyContents(XmlDictionaryWriter) Método

Definición

Escribe el contenido del cuerpo del mensaje.

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

XmlDictionaryWriter utilizado para escribir el cuerpo del mensaje.

Excepciones

writer es null.

Ejemplos

En el ejemplo de código siguiente se muestra cómo llamar al método 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()

Comentarios

La implementación predeterminada de WriteBodyContents(XmlDictionaryWriter) llama a OnWriteBodyContents(XmlDictionaryWriter), de modo que invalidar OnWriteBodyContents(XmlDictionaryWriter), se proporcione el mejor punto de extensión.

Se aplica a