HtmlDialogElement
sealed class HtmlDialogElement : HtmlElement, IHtmlDialogElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
Represents the object for HTML dialog elements.
using AngleSharp.Dom.Css;
using AngleSharp.Extensions;
using AngleSharp.Html;
namespace AngleSharp.Dom.Html
{
internal sealed class HtmlDialogElement : HtmlElement, IHtmlDialogElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle
{
private string _returnValue;
public bool Open {
get {
return this.HasOwnAttribute(AttributeNames.Open);
}
set {
this.SetOwnAttribute(AttributeNames.Open, value ? string.Empty : null);
}
}
public string ReturnValue {
get {
return _returnValue;
}
set {
_returnValue = value;
}
}
public HtmlDialogElement(Document owner, string prefix = null)
: base(owner, TagNames.Dialog, prefix, NodeFlags.None)
{
}
public void Show(IElement anchor = null)
{
Open = true;
}
public void ShowModal(IElement anchor = null)
{
Open = true;
}
public void Close(string returnValue = null)
{
Open = false;
ReturnValue = returnValue;
}
}
}