Inheritance: LayoutFarm.WebDom.Impl.HtmlDocument
Esempio n. 1
0
        public DomElement GetPageBody(DomElement hostNode)
        {
            if (_contentNode != null)
            {
                return(_contentNode);
            }
            HtmlDocument ownerdoc = (HtmlDocument)hostNode.OwnerDocument;

            _contentNode = ownerdoc.CreateHtmlDiv();
            if (_contentUI != null)
            {
                //add content ui to the body of page
                //creat html wrapper for this ...

                //  throw new NotImplementedException();
                //reimpl here again
                LayoutFarm.Composers.HtmlDocument htmldoc = (LayoutFarm.Composers.HtmlDocument)ownerdoc;
                var wrapperElement = htmldoc.CreateWrapperElement("x",
                                                                  (RootGraphic rootgfx, out RenderElement renderE, out object controller) =>
                {
                    renderE    = _contentUI.GetPrimaryRenderElement(rootgfx);
                    controller = _contentUI;
                });
                _contentNode.AddChild(wrapperElement);
            }
            return(_contentNode);
        }
Esempio n. 2
0
        private HtmlHost(WebDom.CssActiveSheet activeSheet)
        {

            this.BaseStylesheet = activeSheet;
            this.commonHtmlDoc = new HtmlDocument();
            this.commonHtmlDoc.CssActiveSheet = activeSheet;
        }
Esempio n. 3
0
 /// <summary>
 /// Parses the source html to css boxes tree structure.
 /// </summary>
 /// <param name="source">the html source to parse</param>
 public static HtmlDocument ParseDocument(TextSource snapSource)
 {
     var parser = GetHtmlParser();
     //------------------------
     var blankHtmlDoc = new HtmlDocument();
     parser.Parse(snapSource, blankHtmlDoc, blankHtmlDoc.RootNode);
     FreeHtmlParser(parser);
     return blankHtmlDoc;
 }
Esempio n. 4
0
        protected override void OnStartDemo(SampleViewport viewport)
        {
            this.sampleViewport = viewport;
            imageContentMan = new ContentManagers.ImageContentManager();
            imageContentMan.ImageLoadingRequest += (s, e) =>
            {
                e.SetResultImage(LoadBitmap(e.ImagSource));
            };
            //init host 
            myHtmlHost = HtmlHostCreatorHelper.CreateHtmlHost(viewport,
              (s, e) => this.imageContentMan.AddRequestImage(e.ImageBinder),
              (s, e) => { });
            //-----------------------------------------------------

            this.groundHtmlBox = new HtmlBox(myHtmlHost, 800, 600);
            string html = @"<div></div>";
            //if you want to use full html-> use HtmlBox instead  

            this.sampleViewport.AddContent(groundHtmlBox);
            //----------------------------------------------------- 
            groundHtmlBox.LoadHtmlFragmentString(html);
            this.groundHtmlDoc = groundHtmlBox.HtmlContainer.WebDocument as HtmlDocument;
            OnHtmlHostCreated();
        }
Esempio n. 5
0
 //-----------------------------------------------------------------------------------------------------
 void ClearWaitingContent()
 {
     this.waitingHtmlDoc = null;
     this.waitingHtmlString = null;
     waitingContentKind = WaitingContentKind.NoWaitingContent;
 }
Esempio n. 6
0
 public void LoadHtmlDom(HtmlDocument htmldoc)
 {
     if (htmlRenderBox == null)
     {
         this.waitingContentKind = WaitingContentKind.HtmlDocument;
         this.waitingHtmlDoc = htmldoc;
     }
     else
     {
         //just parse content and load 
         this.myHtmlCont = HtmlContainerHelper.CreateHtmlContainer(this.htmlhost, htmldoc, htmlRenderBox);
         SetHtmlContainerEventHandlers();
         ClearWaitingContent();
         RaiseLayoutFinished();
     }
 }
 public ShadowRootElement(HtmlDocument owner, int prefix, int localNameIndex)
     : base(owner, prefix, localNameIndex)
 {
     shadowDoc = new HtmlShadowDocument(owner);
     shadowDoc.SetDomUpdateHandler(owner.DomUpdateHandler);
 }
 public HtmlRootElement(HtmlDocument ownerDoc)
     : base(ownerDoc, 0, 0)
 {
 }
 public ExternalHtmlElement(HtmlDocument owner, int prefix, int localNameIndex, LazyCssBoxCreator lazyCreator)
     : base(owner, prefix, localNameIndex)
 {
     this.lazyCreator = lazyCreator;
 }
Esempio n. 10
0
 internal HtmlElement(HtmlDocument owner, int prefix, int localNameIndex)
     : base(owner, prefix, localNameIndex)
 {
     this.boxSpec = new Css.BoxSpec();
 }
Esempio n. 11
0
 public HtmlRootElement(HtmlDocument ownerDoc)
     : base(ownerDoc, 0, 0)
 {
 }
Esempio n. 12
0
 public ShadowRootElement(HtmlDocument owner, int prefix, int localNameIndex)
     : base(owner, prefix, localNameIndex)
 {
     _shadowDoc = new HtmlShadowDocument(owner.Host, owner);
     _shadowDoc.SetDomUpdateHandler(owner.DomUpdateHandler);
 }
Esempio n. 13
0
 public ExternalHtmlElement(HtmlDocument owner, int prefix, int localNameIndex, LazyCssBoxCreator lazyCreator)
     : base(owner, prefix, localNameIndex)
 {
     _lazyCreator = lazyCreator;
 }