Esempio n. 1
0
        private void RenderToolBar(HtmlTextWriter writer)
        {
            BorderedPanel p = new BorderedPanel();
            p.Page = Page;
            p.ControlStyle.CopyFrom(DefaultToolbarStyle);
            if (ToolbarStyleCreated)
                p.ControlStyle.CopyFrom(ToolbarStyle);

            writer.AddStyleAttribute(HtmlTextWriterStyle.Position, "relative");
            writer.AddStyleAttribute(HtmlTextWriterStyle.ZIndex, "100");
            writer.AddAttribute(HtmlTextWriterAttribute.Id, ClientID + "_ToolBar");
            writer.RenderBeginTag(HtmlTextWriterTag.Div);
            p.RenderBeginTag(writer);
            _toolBar.RenderControl(writer);
            p.RenderEndTag(writer);
            writer.RenderEndTag();
        }
Esempio n. 2
0
 void CreateToolbarButton(Control control)
 {
     MenuItemTemplateContainer container = (MenuItemTemplateContainer)control;
     MenuItem menuItem = (MenuItem)container.DataItem;
     BorderedPanel panel = new BorderedPanel();
     panel.ControlStyle.CopyFrom(DefaultToolbarButtonStyle);
     if (ToolbarButtonStyleCreated)
         panel.ControlStyle.CopyFrom(ToolbarButtonStyle);
     panel.Style[HtmlTextWriterStyle.Cursor] = "default";
     if (menuItem.Enabled)
     {
         panel.HoverSyle.CopyFrom(DefaultToolbarButtonHoverStyle);
         if (ToolbarButtonHoverStyleCreated)
             panel.HoverSyle.CopyFrom(ToolbarButtonHoverStyle);
         panel.PressedSyle.CopyFrom(DefaultToolbarButtonPressedStyle);
         if (ToolbarButtonPressedStyleCreated)
             panel.PressedSyle.CopyFrom(ToolbarButtonPressedStyle);
         panel.Attributes["onclick"] = menuItem.NavigateUrl;
     }
     else
         panel.Style["color"] = "gray";
     container.Controls.Add(panel);
     Table t = new Table();
     t.CellPadding = 0;
     t.CellSpacing = 0;
     t.BorderWidth = 0;
     panel.Controls.Add(t);
     TableRow r = new TableRow();
     t.Rows.Add(r);
     TableCell c1 = new TableCell();
     r.Cells.Add(c1);
     System.Web.UI.WebControls.Image img = new System.Web.UI.WebControls.Image();
     img.ImageUrl = ((MenuItem)container.DataItem).ImageUrl;
     c1.Controls.Add(img);
     TableCell c2 = new TableCell();
     c2.Style[HtmlTextWriterStyle.PaddingLeft] = "2px";
     c2.Style[HtmlTextWriterStyle.PaddingRight] = "2px";
     c2.Text = " " + menuItem.Text;
     r.Cells.Add(c2);
 }
Esempio n. 3
0
        internal override void RenderBeginList(System.Web.UI.HtmlTextWriter output)
        {
            BorderedPanel panel = new BorderedPanel();

            panel.Page = fileView.Page;
            if (fileView.DetailsColumnHeaderStyle.HorizontalAlign == HorizontalAlign.NotSet)
            {
                fileView.DetailsColumnHeaderStyle.HorizontalAlign = fileView.Controller.CurrentUICulture.TextInfo.IsRightToLeft ? HorizontalAlign.Right : HorizontalAlign.Left;
            }
            panel.ControlStyle.CopyFrom(fileView.DetailsColumnHeaderStyle);

            output.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            output.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            output.AddAttribute(HtmlTextWriterAttribute.Border, "0");
            output.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            output.RenderBeginTag(HtmlTextWriterTag.Table);
            output.RenderBeginTag(HtmlTextWriterTag.Thead);
            output.RenderBeginTag(HtmlTextWriterTag.Tr);
            output.RenderBeginTag(HtmlTextWriterTag.Th);

            output.AddAttribute(HtmlTextWriterAttribute.Onclick, fileView.GetSortEventReference(SortMode.Name));
            output.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "default");
            output.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            output.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            output.AddAttribute(HtmlTextWriterAttribute.Id, fileView.ClientID + "_Thead_Name");

            panel.RenderBeginTag(output);
            output.Write(HttpUtility.HtmlEncode(controller.GetResourceString("Name", "Name")));
            panel.RenderEndTag(output);

            output.RenderEndTag();
            output.RenderBeginTag(HtmlTextWriterTag.Th);

            output.AddAttribute(HtmlTextWriterAttribute.Onclick, fileView.GetSortEventReference(SortMode.Size));
            output.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "default");
            output.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            output.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            output.AddAttribute(HtmlTextWriterAttribute.Id, fileView.ClientID + "_Thead_Size");

            panel.RenderBeginTag(output);
            output.Write(HttpUtility.HtmlEncode(controller.GetResourceString("Size", "Size")));
            panel.RenderEndTag(output);

            output.RenderEndTag();
            output.RenderBeginTag(HtmlTextWriterTag.Th);

            output.AddAttribute(HtmlTextWriterAttribute.Onclick, fileView.GetSortEventReference(SortMode.Type));
            output.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "default");
            output.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            output.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            output.AddAttribute(HtmlTextWriterAttribute.Id, fileView.ClientID + "_Thead_Type");

            panel.RenderBeginTag(output);
            output.Write(HttpUtility.HtmlEncode(controller.GetResourceString("Type", "Type")));
            panel.RenderEndTag(output);

            output.RenderEndTag();
            output.RenderBeginTag(HtmlTextWriterTag.Th);

            output.AddAttribute(HtmlTextWriterAttribute.Onclick, fileView.GetSortEventReference(SortMode.Modified));
            output.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "default");
            output.AddStyleAttribute(HtmlTextWriterStyle.WhiteSpace, "nowrap");
            output.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
            output.AddAttribute(HtmlTextWriterAttribute.Id, fileView.ClientID + "_Thead_Modified");

            panel.RenderBeginTag(output);
            output.Write(HttpUtility.HtmlEncode(controller.GetResourceString("Date_Modified", "Date Modified")));
            panel.RenderEndTag(output);

            output.RenderEndTag();
            output.RenderEndTag();
            output.RenderEndTag();

            output.AddStyleAttribute(HtmlTextWriterStyle.Overflow, "auto");
            output.RenderBeginTag(HtmlTextWriterTag.Tbody);
        }