public XmlElement CreateRecordElement(XmlDocument doc, MergeableFileRecord record)
 {
     SimpleBBSRecord record_content = record.Content as SimpleBBSRecord;
     return doc.CreateElement ("bbs", new string[][] {
         new string[] {"short-id", record_content.GetShortId (record)},
         new string[] {"is-new", record_content.IsNew ? "true" : "false"}
     }, new[] {
         doc.CreateElement ("name", null, new[] {
             doc.CreateTextNodeSafe (record_content.Name)
         }),
         doc.CreateElement ("body", null, new[] {
             doc.CreateTextNodeSafe (record_content.Body)
         })
     });
 }
Exemple #2
0
 XmlNode CreateWikiBodyFromPukiWikiMarkup(XmlDocument doc, WikiRecord content)
 {
     WikiRootElement root = PukiWikiMarkupParser.Instance.Parse (content.Body);
     return doc.CreateTextNodeSafe (WikiHtmlRenderer.Instance.Render (root, PukiWikiMarkupParser.Instance));
 }
Exemple #3
0
 public XmlElement CreateRecordElement(XmlDocument doc, MergeableFileRecord record)
 {
     WikiRecord content = record.Content as WikiRecord;
     return doc.CreateElement ("wiki", new string[][] {
         new string[] {"markup-type", content.MarkupType.ToString ()}
     }, new[] {
         doc.CreateElement ("title", null, new[] {
             doc.CreateTextNodeSafe (content.PageName)
         }),
         doc.CreateElement ("title-for-url", null, new[] {
             doc.CreateTextNodeSafe (WikiWebApp.WikiTitleToUrl (content.PageName))
         }),
         doc.CreateElement ("name", null, new[] {
             doc.CreateTextNodeSafe (content.Name)
         }),
         doc.CreateElement ("body", null, new[] {
             CreateWikiBody (doc, content)
         }),
         doc.CreateElement ("raw-body", null, new[] {
             doc.CreateTextNodeSafe (content.Body)
         }),
     });
 }
Exemple #4
0
 XmlNode CreateWikiBodyFromPlainText(XmlDocument doc, WikiRecord content)
 {
     return doc.CreateTextNodeSafe (content.Body);
 }