public TElement(IElement htmlElement, TElement parent) { NormalFlowChildren = new List <TElement>(); FloatFlowChildren = new List <TElement>(); AbsoluteFlowChildren = new List <TElement>(); DefaultBackgroundColor = new Color(255, 255, 255, 255); DefaultBorderColor = new Color(0, 0, 0, 255); DefaultForegroundColor = new Color(0, 0, 0, 255); Parent = parent; Children = new List <TElement>(); Canvas = GfxFactory.Create <IGfxCanvas>(); InitHtml(htmlElement); InitCss(htmlElement); ComputeBoundingBox(); var elementFactory = new TElementFactory(); foreach (IElement htmlChild in htmlElement.Children) { var child = elementFactory.Create(htmlChild, this); Children.Add(child); ComputeBoundingBox(child); AddToFlowList(child); } }
public void Parse(string html) { var config = new Configuration().WithCss(); var parser = new HtmlParser(config ?? Configuration.Default); var document = parser.Parse(html); var factory = new TElementFactory(); Body = factory.Create(document.Body, null); }
public void Parse(AngleSharp.Dom.IElement htmlElement) { InitHtml(htmlElement); InitCss(htmlElement); ComputeBoundingBox(); var elementFactory = new TElementFactory(); foreach (AngleSharp.Dom.IElement htmlChild in htmlElement.Children) { var element = elementFactory.Create(htmlChild); element.Parent = this; element.Parse(htmlChild); Children.Add(element); ComputeBoundingBox(element); AddToFlowList(element); } }
private void btnOK_Click(object sender, EventArgs e) { //if (editing == false) //{ // //this.ConstantElement = new TElement_Constant(tbConstantName.Text, CVRT.GetBytes(tbCharacterInput.Text)); //} //else //{ // //constantElement.elementName = tbConstantName.Text; // //constantElement.elementBytes = CVRT.GetBytes(tbCharacterInput.Text); //} DE ConstantDataElement = new DE(tbConstantName.Text, cbConstantType.SelectedItem.ToString(), tbConstantValue.Text); this.ConstantElement = TElementFactory.TElementPicker(tbConstantName.Text, ConstantDataElement); this.DialogResult = DialogResult.OK; }