AngleSharp by AngleSharp

<PackageReference Include="AngleSharp" Version="0.9.7" />

.NET API 1,204,224 bytes

 HtmlEmbedElement

Represents the embed element.
using AngleSharp.Dom.Css; using AngleSharp.Dom.Events; using AngleSharp.Extensions; using AngleSharp.Html; using AngleSharp.Network; using AngleSharp.Network.RequestProcessors; namespace AngleSharp.Dom.Html { internal sealed class HtmlEmbedElement : HtmlElement, IHtmlEmbedElement, IHtmlElement, IElement, INode, IEventTarget, IMarkupFormattable, IParentNode, IChildNode, INonDocumentTypeChildNode, IElementCssInlineStyle, IGlobalEventHandlers, ILoadableElement { private readonly ObjectRequestProcessor _request; public IDownload CurrentDownload { get { if (_request == null) return null; return _request.Download; } } public string Source { get { return this.GetOwnAttribute(AttributeNames.Src); } set { this.SetOwnAttribute(AttributeNames.Src, value, false); } } public string Type { get { return this.GetOwnAttribute(AttributeNames.Type); } set { this.SetOwnAttribute(AttributeNames.Type, value, false); } } public string DisplayWidth { get { return this.GetOwnAttribute(AttributeNames.Width); } set { this.SetOwnAttribute(AttributeNames.Width, value, false); } } public string DisplayHeight { get { return this.GetOwnAttribute(AttributeNames.Height); } set { this.SetOwnAttribute(AttributeNames.Height, value, false); } } static HtmlEmbedElement() { Element.RegisterCallback(AttributeNames.Src, delegate(HtmlEmbedElement element, string value) { element.UpdateSource(value); }); } public HtmlEmbedElement(Document owner, string prefix = null) : base(owner, TagNames.Embed, prefix, NodeFlags.SelfClosing | NodeFlags.Special) { _request = ObjectRequestProcessor.Create(this); } internal override void SetupElement() { base.SetupElement(); string ownAttribute = this.GetOwnAttribute(AttributeNames.Src); if (ownAttribute != null) UpdateSource(ownAttribute); } private void UpdateSource(string value) { Url url = new Url(Source); this.Process(_request, url); } } }