HtmlMenuItemElement
sealed class HtmlMenuItemElement : HtmlElement, IHtmlMenuItemElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IGlobalEventHandlers
Represents the HTML menuitem element.
using AngleSharp.Dom.Css;
using AngleSharp.Dom.Events;
using AngleSharp.Extensions;
using AngleSharp.Html;
namespace AngleSharp.Dom.Html
{
internal sealed class HtmlMenuItemElement : HtmlElement, IHtmlMenuItemElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IGlobalEventHandlers
{
internal bool IsVisited { get; set; }
internal bool IsActive { get; set; }
public IHtmlElement Command {
get {
string ownAttribute = this.GetOwnAttribute(AttributeNames.Command);
if (!string.IsNullOrEmpty(ownAttribute))
return base.Owner?.GetElementById(ownAttribute) as IHtmlElement;
return null;
}
}
public string Type {
get {
return this.GetOwnAttribute(AttributeNames.Type);
}
set {
this.SetOwnAttribute(AttributeNames.Type, value, false);
}
}
public string Label {
get {
return this.GetOwnAttribute(AttributeNames.Label);
}
set {
this.SetOwnAttribute(AttributeNames.Label, value, false);
}
}
public string Icon {
get {
return this.GetOwnAttribute(AttributeNames.Icon);
}
set {
this.SetOwnAttribute(AttributeNames.Icon, value, false);
}
}
public bool IsDisabled {
get {
return this.HasOwnAttribute(AttributeNames.Disabled);
}
set {
this.SetOwnAttribute(AttributeNames.Disabled, value ? string.Empty : null, false);
}
}
public bool IsChecked {
get {
return this.HasOwnAttribute(AttributeNames.Checked);
}
set {
this.SetOwnAttribute(AttributeNames.Checked, value ? string.Empty : null, false);
}
}
public bool IsDefault {
get {
return this.HasOwnAttribute(AttributeNames.Default);
}
set {
this.SetOwnAttribute(AttributeNames.Default, value ? string.Empty : null, false);
}
}
public string RadioGroup {
get {
return this.GetOwnAttribute(AttributeNames.Radiogroup);
}
set {
this.SetOwnAttribute(AttributeNames.Radiogroup, value, false);
}
}
public HtmlMenuItemElement(Document owner, string prefix = null)
: base(owner, TagNames.MenuItem, prefix, NodeFlags.SelfClosing | NodeFlags.Special)
{
}
}
}