BodyWriter.WriteBodyContents(XmlDictionaryWriter) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Écrit le contenu du corps du message.
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)
Paramètres
- writer
- XmlDictionaryWriter
Utilisé XmlDictionaryWriter pour écrire le corps du message.
Exceptions
writer a la valeur null.
Exemples
L’exemple suivant montre comment appeler la WriteBodyContents(XmlDictionaryWriter) méthode.
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()
Remarques
L’implémentation par défaut des WriteBodyContents(XmlDictionaryWriter) appels OnWriteBodyContents(XmlDictionaryWriter), ainsi la OnWriteBodyContents(XmlDictionaryWriter) substitution fournit le meilleur point d’extension.