AttachEssentialHandlers() public method

public AttachEssentialHandlers ( EventHandler domVisualRefreshHandler, EventHandler domRequestRebuildHandler, EventHandler containerInvalidateGfxHanlder, EventHandler domFinished ) : void
domVisualRefreshHandler EventHandler
domRequestRebuildHandler EventHandler
containerInvalidateGfxHanlder EventHandler
domFinished EventHandler
return void
Ejemplo n.º 1
0
        public void SetHtmlHost(HtmlHost htmlhost)
        {
            this.htmlhost = htmlhost;

            htmlhost.SetHtmlContainerUpdateHandler(htmlCont =>
            {
                var updatedHtmlCont = htmlCont as MyHtmlContainer;
                if (updatedHtmlCont != null && !updatedHtmlCont.IsInUpdateQueue)
                {
                    updatedHtmlCont.IsInUpdateQueue = true;
                    waitingUpdateList.Add(updatedHtmlCont);
                }
            });

            htmlContainer = new MyHtmlContainer(htmlhost);
            htmlContainer.AttachEssentialHandlers(
                OnRefresh,
                myHtmlContainer_NeedUpdateDom,
                OnRefresh,
                null);

            htmlLayoutVisitor = new LayoutVisitor(this.gfxPlatform);
            htmlLayoutVisitor.Bind(htmlContainer);


            //-------------------------------------------------------
            timer01.Interval = 20;//20ms?
            timer01.Tick    += (s, e) =>
            {
                //clear waiting
                int j = waitingUpdateList.Count;
                for (int i = 0; i < j; ++i)
                {
                    var htmlCont = waitingUpdateList[i];
                    htmlCont.IsInUpdateQueue = false;
                    htmlCont.RefreshDomIfNeed();
                }
                for (int i = j - 1; i >= 0; --i)
                {
                    waitingUpdateList.RemoveAt(i);
                }
            };
            timer01.Enabled = true;
            //-------------------------------------------
            _htmlInputEventAdapter = new HtmlInputEventAdapter(gfxPlatform.SampleIFonts);
            _htmlInputEventAdapter.Bind(htmlContainer);
            //-------------------------------------------
        }
Ejemplo n.º 2
0
 public void SetHtmlHost(HtmlHost htmlhost)
 {
     this.htmlhost = htmlhost;
     htmlhost.SetHtmlContainerUpdateHandler(htmlCont =>
     {
         var updatedHtmlCont = htmlCont as MyHtmlContainer;
         if (updatedHtmlCont != null && !updatedHtmlCont.IsInUpdateQueue)
         {
             updatedHtmlCont.IsInUpdateQueue = true;
             waitingUpdateList.Add(updatedHtmlCont);
         }
     });
     htmlContainer = new MyHtmlContainer(htmlhost);
     htmlContainer.AttachEssentialHandlers(
         OnRefresh,
         myHtmlContainer_NeedUpdateDom,
         OnRefresh,
         null);
     htmlLayoutVisitor = new LayoutVisitor();
     htmlLayoutVisitor.Bind(htmlContainer);
     //------------------------------------------------------- 
     timer01.Interval = 20;//20ms?
     timer01.Tick += (s, e) =>
     {
         //clear waiting
         int j = waitingUpdateList.Count;
         for (int i = 0; i < j; ++i)
         {
             var htmlCont = waitingUpdateList[i];
             htmlCont.IsInUpdateQueue = false;
             htmlCont.RefreshDomIfNeed();
         }
         for (int i = j - 1; i >= 0; --i)
         {
             waitingUpdateList.RemoveAt(i);
         }
     };
     timer01.Enabled = true;
     //-------------------------------------------
     _htmlInputEventAdapter = new HtmlInputEventAdapter();
     _htmlInputEventAdapter.Bind(htmlContainer);
     //-------------------------------------------
 }