Files
qwsdcvghyu89 a7d148a96f Introduce Beam.Fluent and Beam.Models projects
Added new Beam.Fluent and Beam.Models projects with staged download builder and data context models. Refactored and moved model classes from Beam.Temporary.Cli to Beam.Models. Added new data providers and extended DataBindings in Beam.Dynamic. Renamed Beam.Puppeteer to Beam.Playwright and updated related classes. Updated project references and package versions. Removed obsolete and unused files from Beam.Temporary.Cli.
2025-09-18 18:32:25 +10:00

21 lines
908 B
C#

using HtmlAgilityPack;
using System.Text.Json.Serialization;
namespace Beam.Dynamic {
[JsonDerivedType(typeof(ParagraphedContentDataProvider), "paragraphed")]
[JsonDerivedType(typeof(ListContentDataProvider), "list")]
[JsonDerivedType(typeof(ContentsArrayDataProvider), "array")]
[JsonDerivedType(typeof(ContentsDataProvider), "single")]
[JsonDerivedType(typeof(DropDownDataProvider), "dropdown")]
[JsonDerivedType(typeof(AnchorCollectionDataProvider), "anchor-list")]
[JsonDerivedType(typeof(AnchorDataProvider), "anchor")]
public interface IDataProvider {
public string GetString(HtmlDocument document)
=> (this as IDataProvider<object>)?.Get(document)?.ToString() ?? "";
}
public interface IDataProvider<out T> : IDataProvider {
public T Get(HtmlDocument document);
//public HtmlNode? GetNode(HtmlDocument document);
}
}