Exemplo n.º 1
0
        //================================
        // Methods
        //================================
        private void ParseContent(XmlElement element, Content parentContent)
        {
            if (parentContent == null)
            {
                return;
            }

            var index = 1;

            foreach (var childElement in element.ChildNodes.OfType <XmlElement>())
            {
                Content content = childElement.Name switch
                {
                    "Group" => this.ParseGroup(childElement),
                    "PlainText" => this.ParsePlainText(childElement),
                    "NotesvelText" => this.ParseNotesvelText(childElement),
                    "Markdown" => this.ParseMarkdown(childElement),
                    _ => null,
                };

                if (content != null)
                {
                    parentContent.AddChildContent(content);
                    if (!content.IsEntity)
                    {
                        this.ParseContent(childElement, content);
                    }
                    index++;
                }
            }

            return;
        }