LayoutFarm.DzBoardSample.MenuBoardModule.OnStartModule C# (CSharp) Method

OnStartModule() protected method

protected OnStartModule ( ) : void
return void
        protected override void OnStartModule()
        {
            var htmlBox = new HtmlBox(htmlHost, 500, 40);
            viewport.AddContent(htmlBox);
            //design buttons here 

            string htmltext = @"<html><head></head><body id='body_elem'>
                <span id='cmd_box' style='padding:2px'>Box</span>
                <span id='cmd_rect' style='padding:2px'>Rect</span>   
                <span id='cmd_img' style='padding:2px'>Image</span>                 
            </body></html>";
            htmlBox.LoadHtmlString(htmltext);
            var dom1 = htmlBox.HtmlContainer.WebDocument as LayoutFarm.WebDom.IHtmlDocument;
            if (dom1 != null)
            {
                var bodyElemet = dom1.getElementById("body_elem");
                bodyElemet.attachEventListener("mousedown", e =>
                {
                    var srcElement = e.ExactHitObject;
                    HtmlBoxes.CssRun run = srcElement as HtmlBoxes.CssRun;
                    if (run != null)
                    {
                        menuItemClick(this, new MenuItemClickEventArgs(run.Text));
                    }
                    e.StopPropagation();
                });
            }
        }
    }
MenuBoardModule