849bdcd089
- 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.
20 lines
548 B
C#
20 lines
548 B
C#
|
|
using aeqw89.DataKeys;
|
|
using HtmlAgilityPack;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace Beam.Dynamic {
|
|
public class Binding(DataKey<Binding> key) : IBinding, IKeyed<Binding> {
|
|
public Binding(string key) : this(new DataKey<Binding>(key)) { }
|
|
public Binding() : this("") { }
|
|
|
|
[JsonRequired]
|
|
public DataKey<Binding> Key { get; set; } = key;
|
|
|
|
public string? XPath { get; set; }
|
|
public string? CssPath { get; set; }
|
|
public string? Text { get; set; }
|
|
}
|
|
}
|