namespace AIStudio.Assistants.Dynamic; public sealed class WebContentState { public string Content { get; set; } = string.Empty; public string URL { get; set; } = string.Empty; public bool Preselect { get; set; } public bool PreselectContentCleaner { get; set; } public bool CleanerIsRunning { get; set; } /// /// Creates a copy which shares nothing with this state. /// /// The copy. public WebContentState Copy() => new() { Content = this.Content, URL = this.URL, Preselect = this.Preselect, PreselectContentCleaner = this.PreselectContentCleaner, CleanerIsRunning = this.CleanerIsRunning, }; /// /// Tells whether another state holds the same inputs as this one. /// /// /// Whether the content cleaner runs is not an input: it is work in progress, which ends with the component that started it. /// /// The state to compare with. /// true when both states hold the same inputs; otherwise, false. 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; }