示例#1
0
        public static WebPage ParseFromFile(File file)
        {
            WebPage page = new WebPage();

            page.title   = file.Name;
            page.content = file.Content;
            MatchCollection matches = Regex.Matches(file.Content, "(<!interface.*>.*<\\/interface>)", RegexOptions.Multiline);

            foreach (Match match in matches)
            {
                var newInterface = WebInterface.ParseFromTag(match.Value, file);
                if (newInterface == null)
                {
                    continue;
                }
                page.content = page.content.Replace(match.Value, newInterface.GetClientDisplay());
                page.interfaces.Add(newInterface.ID, newInterface);
            }
            return(page);
        }