public XmlElement Serialize(Block block, XmlDocument xmlDocument) { var paragraphSerializeStrategy = new ParagraphSerializeStrategy(); var list = (List)block; var listElement = xmlDocument.CreateElement(_tagName); foreach (var listItem in list.ListItems) { var listItemElement = xmlDocument.CreateElement("Item"); foreach (var listItemBlock in listItem.Blocks) { listItemElement.AppendChild(paragraphSerializeStrategy.Serialize(listItemBlock, xmlDocument)); } listElement.AppendChild(listItemElement); } return(listElement); }
public XmlElement Serialize(Block block, XmlDocument xmlDocument) { var paragraphSerializeStrategy = new ParagraphSerializeStrategy(); var list = (List) block; var listElement = xmlDocument.CreateElement(_tagName); foreach (var listItem in list.ListItems) { var listItemElement = xmlDocument.CreateElement("Item"); foreach (var listItemBlock in listItem.Blocks) { listItemElement.AppendChild(paragraphSerializeStrategy.Serialize(listItemBlock, xmlDocument)); } listElement.AppendChild(listItemElement); } return listElement; }