예제 #1
0
파일: Menu.cs 프로젝트: msvarovsky/PDMSCore
        public TagBuilder HtmlText(int Level)
        {
            /*
             * Projects    Search project
             *          Create new project
             *          -- - Recent-- -
             *          Project 1       Global info
             *                          Spec
             *                          Pack copy
             *          Project 2       Global info
             *                          Spec
             *                          Pack copy
             */

            TagBuilder tbOuter = new TagBuilder("div");

            /* MenuItemLx musi byt pred MIExpanded. Aby se toho docililo, tak sa do tbOuter musi pridat az po MIExpanded.*/
            AddCssClass(tbOuter, Selected, "MISelected");
            AddCssClass(tbOuter, Empty, "MIEmpty");
            AddCssClass(tbOuter, Expanded, "MIExpanded");

            //
            //tbOuter.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "ReloadPageContent", "Project/ShowProject", "dataDoMVC"));
            tbOuter.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "OnNavItemClick", "this", "MIL", Url, ""));

            /*tbOuter.Attributes.Add("onclick", "onNavigationItemClick('" +   HttpUtility.JavaScriptStringEncode("ProjectController/ShowProject") +
             *                                                              HttpUtility.JavaScriptStringEncode("ahoj") + "')");*/
            //
            tbOuter.AddCssClass("MenuItemL" + Level.ToString());

            //TagBuilder tbA = new TagBuilder("a");
            TagBuilder tbA = new TagBuilder("div");

            //tbA.Attributes.Add("href", Url);
            tbA.AddCssClass("MenuItemText");
            tbA.InnerHtml.AppendHtml(Label);
            tbA.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "OnNavItemClick", "this", "MIT", Url, ""));


            tbOuter.InnerHtml.AppendHtml(tbA);
            if (!Empty)
            {
                tbOuter.InnerHtml.AppendHtml(TagDivChevronArea());
            }
            return(tbOuter);
        }
예제 #2
0
파일: Menu.cs 프로젝트: msvarovsky/PDMSCore
        private TagBuilder TagDivChevronArea()
        {
            TagBuilder tb = new TagBuilder("div");

            tb.AddCssClass("MIChevronArea");
            tb.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "OnNavItemClick", "this", "MICA", Url, ""));

            TagBuilder tbMIChevron = new TagBuilder("div");

            tbMIChevron.AddCssClass("MIChevron");
            tbMIChevron.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "OnNavItemClick", "this", "MIC", Url, ""));
            AddCssClass(tbMIChevron, Expanded, "MIChevronExpanded");


            tb.InnerHtml.AppendHtml(tbMIChevron);
            return(tb);
        }
예제 #3
0
        public TagBuilder HtmlText()
        {
            if (Level == 0)
            {
                TagBuilder tbUL = new TagBuilder("ul");
                tbUL.Attributes.Add("id", "GlobalMenu");
                for (int i = 0; i < Children.Count; i++)
                {
                    tbUL.InnerHtml.AppendHtml(Children[i].HtmlText());
                }
                return(tbUL);
            }
            else
            {
                TagBuilder tbLI = new TagBuilder("li");
                tbLI.Attributes.Add("id", ID.ToString());
                tbLI.Attributes.Add(WebStuffHelper.CreateJSParameter("onclick", "OnGlobalMenuItemClick", "this", "LI", Url, ID.ToString()));

                TagBuilder tbDiv      = new TagBuilder("div");
                TagBuilder tbLabelDiv = new TagBuilder("div");
                tbLabelDiv.InnerHtml.AppendHtml(Label);
                tbLabelDiv.Attributes.Add("lid", LabelID.ToString());

                tbDiv.InnerHtml.AppendHtml(tbLabelDiv);
                if (Children.Count > 0)
                {
                    TagBuilder tbUL = new TagBuilder("ul");
                    if (Level == 1)
                    {
                        tbUL.AddCssClass("sub-d");
                    }

                    for (int i = 0; i < Children.Count; i++)
                    {
                        tbUL.InnerHtml.AppendHtml(Children[i].HtmlText());
                    }

                    tbDiv.InnerHtml.AppendHtml(tbUL);
                }
                tbLI.InnerHtml.AppendHtml(tbDiv);
                return(tbLI);
            }
        }