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