HTMLMenuItemElement
sealed class HTMLMenuItemElement : HTMLElement, IHtmlMenuItemElement, IHtmlElement, IElement, INode, IEventTarget, IParentNode, IChildNode, IElementCssInlineStyle
Represents the HTML menuitem element.
using AngleSharp.DOM.Css;
namespace AngleSharp.DOM.Html
{
internal sealed class HTMLMenuItemElement : HTMLElement, IHtmlMenuItemElement, IHtmlElement, IElement, INode, IEventTarget, IParentNode, IChildNode, IElementCssInlineStyle
{
public enum ItemType : ushort
{
Command,
Checkbox,
Radio
}
internal bool IsVisited { get; set; }
internal bool IsActive { get; set; }
public IHtmlElement Command {
get {
string attribute = GetAttribute(AttributeNames.Command);
if (!string.IsNullOrEmpty(attribute) && base.Owner != null)
return base.Owner.GetElementById(attribute) as IHtmlElement;
return null;
}
}
public string Type {
get {
return GetAttribute(AttributeNames.Type);
}
set {
SetAttribute(AttributeNames.Type, value);
}
}
public string Label {
get {
return GetAttribute(AttributeNames.Label);
}
set {
SetAttribute(AttributeNames.Label, value);
}
}
public string Icon {
get {
return GetAttribute(AttributeNames.Icon);
}
set {
SetAttribute(AttributeNames.Icon, value);
}
}
public bool IsDisabled {
get {
return GetAttribute(AttributeNames.Disabled) != null;
}
set {
SetAttribute(AttributeNames.Disabled, value ? string.Empty : null);
}
}
public bool IsChecked {
get {
return GetAttribute(AttributeNames.Checked) != null;
}
set {
SetAttribute(AttributeNames.Checked, value ? string.Empty : null);
}
}
public bool IsDefault {
get {
return GetAttribute(AttributeNames.Default) != null;
}
set {
SetAttribute(AttributeNames.Default, value ? string.Empty : null);
}
}
public string RadioGroup {
get {
return GetAttribute(AttributeNames.Radiogroup);
}
set {
SetAttribute(AttributeNames.Radiogroup, value);
}
}
protected internal override bool IsSpecial => true;
internal HTMLMenuItemElement()
{
_name = "menuitem";
}
}
}