다음을 통해 공유


BodyWriter.WriteBodyContents(XmlDictionaryWriter) 메서드

정의

메시지 본문 콘텐츠를 씁니다.

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)

매개 변수

writer
XmlDictionaryWriter

메시지 본문을 쓰는 데 사용되는 XmlDictionaryWriter입니다.

예외

writer이(가) null인 경우

예제

다음 예제에서는 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()

설명

WriteBodyContents(XmlDictionaryWriter)의 기본 구현은 OnWriteBodyContents(XmlDictionaryWriter)를 호출하므로 OnWriteBodyContents(XmlDictionaryWriter)를 재정의하여 최상의 확장성 지점을 얻을 수 있습니다.

적용 대상