Пример #1
0
        private TableRow GenerateCommonMenu(Menuitem toMenuitem, int tnCurLevel)
        {
            TableRow  loRow;
            TableCell loCell;
            HyperLink loHyper;
            Literal   loText;

            System.Web.UI.WebControls.Image loImage;

            loRow  = new TableRow();
            loCell = new TableCell();
            loCell.VerticalAlign   = VerticalAlign.Top;
            loCell.HorizontalAlign = HorizontalAlign.Left;
            loHyper = new HyperLink();
            loText  = new Literal();

            if (toMenuitem.HyperLink == "")
            {
                loText.Text = toMenuitem.Caption;
                loCell.Controls.Add(loText);
                loCell.CssClass   = this._cssItem;
                loCell.ColumnSpan = 2;
            }
            else
            {
                loCell.VerticalAlign = VerticalAlign.Top;
                loCell.ColumnSpan    = 1;
                loImage = new System.Web.UI.WebControls.Image();
                if (tnCurLevel == 2)
                {
                    loImage.ImageUrl = this._MasterImage;
                    loImage.Width    = 8;
                }
                else
                {
                    loImage.Width    = 16;
                    loImage.ImageUrl = this._SubImage;
                }
                loImage.Height      = 15;
                loImage.BorderWidth = 0;
                loCell.Controls.Add(loImage);

                loHyper.Text        = toMenuitem.Caption;
                loHyper.NavigateUrl = "/" + AppDir + "/" + BasePage.AppendQueryString(toMenuitem.HyperLink, "");
                loHyper.CssClass    = this._cssSubitem;
                loCell.Controls.Add(loHyper);
            }
            loRow.Cells.Add(loCell);
            return(loRow);
        }