Peek() public méthode

This is used to peek at the node from the document. This will scan through the document, ignoring any comments to find the next relevant XML event to acquire. Typically events will be the start and end of an element, as well as any text nodes.
public Peek ( ) : EventNode,
Résultat EventNode,
Exemple #1
0
        public void ReaderTest1()
        {
            DummyRender render = new DummyRender();
            Document    doc    = new Document();

            doc.LayoutLines.Render = render;
            doc.Append("a");
            DocumentReader reader = doc.CreateReader();

            Assert.IsTrue(reader.Read() == 'a');
            Assert.IsTrue(reader.Peek() == -1);
        }
Exemple #2
0
        public void ReaderTest2()
        {
            DummyRender render = new DummyRender();
            Document    doc    = new Document();

            doc.LayoutLines.Render = render;
            doc.Append("abc");
            DocumentReader reader = doc.CreateReader();

            char[] buf   = new char[2];
            int    count = reader.Read(buf, 1, 2);

            Assert.IsTrue(buf[0] == 'b' && buf[1] == 'c');
            Assert.IsTrue(count == 2);
            Assert.IsTrue(reader.Peek() == -1);
        }