LayoutFarm.HtmlBoxes.MyHtmlContainer.AttachEssentialHandlers C# (CSharp) Method

AttachEssentialHandlers() public method

public AttachEssentialHandlers ( EventHandler domVisualRefreshHandler, EventHandler domRequestRebuildHandler, EventHandler containerInvalidateGfxHanlder, EventHandler domFinished ) : void
domVisualRefreshHandler EventHandler
domRequestRebuildHandler EventHandler
containerInvalidateGfxHanlder EventHandler
domFinished EventHandler
return void
        public void AttachEssentialHandlers(EventHandler domVisualRefreshHandler,
            EventHandler domRequestRebuildHandler,
            EventHandler containerInvalidateGfxHanlder,
            EventHandler domFinished)
        {
            this.domVisualRefresh = domVisualRefreshHandler;
            this.domRequestRebuild = domRequestRebuildHandler;
            this.containerInvalidateGfxHandler = containerInvalidateGfxHanlder;
            this.domFinished = domFinished;
        }
        public void DetachEssentialHandlers()

Usage Example

示例#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);
            //-------------------------------------------
        }
All Usage Examples Of LayoutFarm.HtmlBoxes.MyHtmlContainer::AttachEssentialHandlers