internal static OpmlOutline ParseXml(XmlElement node) { var newOutline = new OpmlOutline(); newOutline.Text = ParseElement(node, "text"); newOutline.Type = ParseElement(node, "type"); newOutline.IsComment = (ParseElement(node, "isComment") == "true" ? true : false); newOutline.IsBreakpoint = (ParseElement(node, "isBreakpoint") == "true" ? true : false); try { newOutline.Created = DateTime.Parse(ParseElement(node, "created")); } catch (Exception ex) { Logger.Error(ex); } newOutline.Category = ParseElement(node, "category"); try { newOutline.XmlUrl = new Uri(ParseElement(node, "xmlUrl")); } catch (Exception ex) { Logger.Error(ex); } try { newOutline.HtmlUrl = new Uri(ParseElement(node, "htmlUrl")); } catch (Exception ex) { Logger.Error(ex); } newOutline.Language = ParseElement(node, "language"); newOutline.Title = ParseElement(node, "title"); try { newOutline.Url = new Uri(ParseElement(node, "url")); } catch (Exception ex) { Logger.Error(ex); } newOutline.Description = ParseElement(node, "description"); if (node.HasChildNodes) { foreach (XmlElement childNode in node.SelectNodes("./outline")) { newOutline.Outlines.Add(ParseXml(childNode)); } } return(newOutline); }
public void AddOutline(string text, string type, Uri xmlUrl, string category, OpmlOutlines outlines) { var item = new OpmlOutline(); item.Text = text; item.Type = type; item.XmlUrl = xmlUrl; item.Category = category; item.Outlines = outlines; _outlines.Add(item); }
public void AddOutline(OpmlOutline item) { _outlines.Add(item); }