Add project files.

This commit is contained in:
2025-04-19 20:47:58 +03:00
parent 9e14d137ae
commit bfdcdb1f3b
66 changed files with 2394 additions and 0 deletions
@@ -0,0 +1,35 @@
using HtmlAgilityPack;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Beam.Dynamic {
public class ParagraphedContentDataProvider : IDataProvider {
public Binding? Content { get; set; }
public string Get(HtmlDocument document) {
if (Content is null)
return "";
var node = Content.ResolveNode(document);
if (node is null)
return "";
StringBuilder content = new();
foreach(var childNode in node.ChildNodes) {
if (childNode.Name != "p")
continue;
content.AppendLine(childNode.InnerText);
}
return content.ToString();
}
public HtmlNode? GetNode(HtmlDocument document) {
return Content?.ResolveNode(document);
}
}
}