LayoutFarm.HtmlWidgets.TabPage.GetTitleNode C# (CSharp) Method

GetTitleNode() public method

public GetTitleNode ( DomElement hostNode ) : DomElement
hostNode LayoutFarm.WebDom.DomElement
return LayoutFarm.WebDom.DomElement
        public DomElement GetTitleNode(DomElement hostNode)
        {
            //-------------------------------------
            if (titleNode != null) return titleNode;
            //create dom node
            var ownerdoc = hostNode.OwnerDocument;
            this.titleNode = ownerdoc.CreateElement("div");
            titleNode.SetAttribute("style", "display:inline");
            titleNode.AddChild("span", span =>
            {
                if (PageTitle == null)
                {
                    span.AddTextContent("");
                }
                else
                {
                    span.AddTextContent(this.PageTitle);
                }
                span.AttachMouseDownEvent(e =>
                {
                    if (this.OwnerContainer != null)
                    {
                        this.OwnerContainer.ChildNotifyTabMouseDown(this);
                    }
                });
            });
            ////mouse down on title
            //titleNode.AttachMouseDownEvent(e =>
            //{


            //});
            //-------------------------------------
            return titleNode;
        }
        public DomElement GetPageBody(DomElement hostNode)

Usage Example

Esempio n. 1
0
        public void AddItem(TabPage tabPage)
        {
            //1. store in collection

            tabPageCollection.Add(tabPage);
            tabPage.OwnerContainer = this;
            if (pnode != null)
            {
                if (currentPage == null)
                {
                    currentPage = tabPage;
                    //add tab button into list
                    this.tabTitleList.AddChild(tabPage.GetTitleNode(pnode));
                    //add page body
                    contentNode.AddChild(tabPage.GetPageBody(pnode));
                }
                else
                {
                    //add tab button into list
                    this.tabTitleList.AddChild(tabPage.GetTitleNode(pnode));
                }
            }
        }
All Usage Examples Of LayoutFarm.HtmlWidgets.TabPage::GetTitleNode