HTMLMenuItemElement
Represents the HTML menuitem element.
namespace AngleSharp.DOM.Html
{
[DOM("HTMLMenuItemElement")]
public sealed class HTMLMenuItemElement : HTMLElement
{
public enum ItemType : ushort
{
Command,
Checkbox,
Radio
}
internal bool IsVisited { get; set; }
internal bool IsActive { get; set; }
[DOM("command")]
public Element Command {
get {
string attribute = GetAttribute("command");
if (!string.IsNullOrEmpty(attribute) && _owner != null)
return _owner.GetElementById(attribute);
return null;
}
}
[DOM("type")]
public ItemType Type {
get {
return Element.ToEnum(GetAttribute("type"), ItemType.Command);
}
set {
SetAttribute("type", value.ToString());
}
}
[DOM("label")]
public string Label {
get {
return GetAttribute("label");
}
set {
SetAttribute("label", value);
}
}
[DOM("icon")]
public string Icon {
get {
return GetAttribute("icon");
}
set {
SetAttribute("icon", value);
}
}
[DOM("disabled")]
public bool Disabled {
get {
return GetAttribute("disabled") != null;
}
set {
SetAttribute("disabled", value ? string.Empty : null);
}
}
[DOM("checked")]
public bool Checked {
get {
return GetAttribute("checked") != null;
}
set {
SetAttribute("checked", value ? string.Empty : null);
}
}
[DOM("default")]
public bool Default {
get {
return GetAttribute("default") != null;
}
set {
SetAttribute("default", value ? string.Empty : null);
}
}
[DOM("radiogroup")]
public string Radiogroup {
get {
return GetAttribute("radiogroup");
}
set {
SetAttribute("radiogroup", value);
}
}
protected internal override bool IsSpecial => true;
internal HTMLMenuItemElement()
{
_name = "menuitem";
}
}
}