コード例 #1
0
        static void Main(string[] args)
        {
            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();
        }
コード例 #2
0
ファイル: snippets.cs プロジェクト: zhimaqiao51/docs
        public static void Snippet2()
        {
            // <Snippet2>
            string[]     strings    = { "Hello", "world" };
            MyBodyWriter bodyWriter = new MyBodyWriter(strings);

            StringBuilder       strBuilder       = new StringBuilder(10);
            XmlWriter           writer           = XmlWriter.Create(strBuilder);
            XmlDictionaryWriter dictionaryWriter = XmlDictionaryWriter.CreateDictionaryWriter(writer);

            bodyWriter.WriteBodyContents(dictionaryWriter);
            dictionaryWriter.Flush();

            MyBodyWriter bufferedBodyWriter = (MyBodyWriter)bodyWriter.CreateBufferedCopy(1024);
            // </Snippet2>
        }