refactor: unify binding & data provider interfaces

- Removed BindingType enum and all related logic from Binding.
- Made Binding implement new IBinding and IKeyed interfaces.
- Moved node selection logic to IBinding.Select; removed Resolve* methods from Binding.
- Added new IBinding interface for XPath/CssPath selection.
- Refactored IDataProvider to generic IDataProvider<T>; removed GetNode.
- Updated ListContentDataProvider and ParagraphedContentDataProvider to use IBinding.
- Added new ContentsDataProvider, ContentsArrayDataProvider, and DropDownDataProvider for flexible data extraction.
- Updated DataBindings to use IDataProvider<T> properties instead of Binding.
- Updated all usages to new interfaces and patterns.
This commit is contained in:
qwsdcvghyu89
2025-06-30 23:31:39 +03:00
parent 87360d75ab
commit 849bdcd089
18 changed files with 448 additions and 129 deletions
@@ -6,14 +6,14 @@ using System.Text;
using System.Threading.Tasks;
namespace Beam.Dynamic {
public class ParagraphedContentDataProvider : IDataProvider {
public Binding? Content { get; set; }
public class ParagraphedContentDataProvider : IDataProvider<string> {
public IBinding? Content { get; set; }
public string Get(HtmlDocument document) {
if (Content is null)
return "";
var node = Content.ResolveNode(document);
var node = Content.Select(document);
if (node is null)
return "";
@@ -26,10 +26,5 @@ namespace Beam.Dynamic {
return content.ToString();
}
public HtmlNode? GetNode(HtmlDocument document) {
return Content?.ResolveNode(document);
}
}
}