AvalonEdit - XMLFolding -> 忽略第一行

AvalonEdit - XMLFolding -> Ignore the first line

尝试更新折叠时是否可以忽略第一行?

Ignore this line
<?xml version="1.0" encoding="UTF-8"?>
<note>
   <to>Tove</to>
   <from>Jani</Ffrom>
   <heading>Reminder</heading>
   <body>Don't forget me this weekend!</body>
</note>

现在这不是一个有效的 XMLDocument,reader 将抛出异常。

以下将跳过第一行

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            StreamReader reader = new StreamReader(FILENAME);
            reader.ReadLine(); // skip first line

            XDocument doc = XDocument.Load(reader);
        }
    }
}