2026-04-09 10:01:24 +02:00
|
|
|
namespace AIStudio.Assistants.Dynamic;
|
|
|
|
|
|
|
|
|
|
public sealed class WebContentState
|
|
|
|
|
{
|
|
|
|
|
public string Content { get; set; } = string.Empty;
|
2026-09-13 16:24:36 +02:00
|
|
|
public string URL { get; set; } = string.Empty;
|
2026-04-09 10:01:24 +02:00
|
|
|
public bool Preselect { get; set; }
|
2026-11-27 12:08:00 +01:00
|
|
|
public bool PreselectContentCleaner { get; set; }
|
|
|
|
|
public bool CleanerIsRunning { get; set; }
|
2026-11-28 11:52:17 +01:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creates a copy which shares nothing with this state.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>The copy.</returns>
|
|
|
|
|
public WebContentState Copy() => new()
|
|
|
|
|
{
|
|
|
|
|
Content = this.Content,
|
|
|
|
|
URL = this.URL,
|
|
|
|
|
Preselect = this.Preselect,
|
|
|
|
|
PreselectContentCleaner = this.PreselectContentCleaner,
|
|
|
|
|
CleanerIsRunning = this.CleanerIsRunning,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Tells whether another state holds the same inputs as this one.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Whether the content cleaner runs is not an input: it is work in progress, which ends with the component that started it.
|
|
|
|
|
/// </remarks>
|
|
|
|
|
/// <param name="other">The state to compare with.</param>
|
|
|
|
|
/// <returns><c>true</c> when both states hold the same inputs; otherwise, <c>false</c>.</returns>
|
|
|
|
|
public bool HasSameInputsAs(WebContentState other) => string.Equals(this.Content, other.Content, StringComparison.Ordinal)
|
|
|
|
|
&& string.Equals(this.URL, other.URL, StringComparison.Ordinal)
|
|
|
|
|
&& this.Preselect == other.Preselect
|
|
|
|
|
&& this.PreselectContentCleaner == other.PreselectContentCleaner;
|
2026-09-13 16:24:36 +02:00
|
|
|
}
|