当前位置: 首页>>代码示例>>C#>>正文


C# HtmlTextWriter.Div方法代码示例

本文整理汇总了C#中System.Web.UI.HtmlTextWriter.Div方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.Div方法的具体用法?C# HtmlTextWriter.Div怎么用?C# HtmlTextWriter.Div使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Web.UI.HtmlTextWriter的用法示例。


在下文中一共展示了HtmlTextWriter.Div方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainInformationSection

        public MainInformationSection(MainStatistics stats)
        {
            var strWr = new StringWriter();
            using (var writer = new HtmlTextWriter(strWr))
            {
                writer
                    .Class("columns")
                    .Div(() => writer
                        .Class("one-third column")
                        .Div(() => writer
                            .Div(() => writer
                                .Class("border-bottom p-3 mb-3")
                                .H2("Time: ")
                                .Class("border border-0 p-3 mb-3")
                                .Div(() => writer
                                    .Ul(() => writer
                                        .Li("Start datetime: " + stats.StartDate)
                                        .Li("Finish datetime: " + stats.EndDate)
                                        .Li("Duration: " + stats.Duration)
                                    )
                                )
                            )
                            .Div(() => writer
                                .Class("border-bottom p-3 mb-3")
                                .H2("Summary: ")
                                .Class("border border-0 p-3 mb-3")
                                .Div(() => writer
                                    .Ul(() => writer
                                        .Li("Total: " + stats.TotalAll)
                                        .Li("Success: " + stats.TotalPassed)
                                        .Li("Errors: " + stats.TotalBroken)
                                        .Li("Failures: " + stats.TotalFailed)
                                        .Li("Inconclusive: " + stats.TotalInconclusive)
                                        .Li("Ignored: " + stats.TotalIgnored)
                                    )
                                )
                            )
                        )
                        .Class("two-thirds column")
                        .Div(() => writer
                            .WithAttr(HtmlTextWriterAttribute.Id, Output.GetStatsPieId())
                            .Tag(HtmlTextWriterTag.Div)
                        )
                    );

            }

            HtmlCode = strWr.ToString();
        }
开发者ID:elv1s42,项目名称:NUnitGo,代码行数:49,代码来源:MainInformationSection.cs

示例2: RenderFileUploadBar

        private void RenderFileUploadBar(HtmlTextWriter writer)
        {
            var onclick = "FileManager_UploadFile(this, '" + ClientID + "_Upload" + "');";
            var left = Controller.IsRightToLeft ? "right" : "left";
            var right = Controller.IsRightToLeft ? "left" : "right";

            writer
                .Div(e => e.Style(AddressBarStyle).Attr(HtmlTextWriterAttribute.Id, ClientID + "_UploadBar"))
                    .Div(e => e.Float(left))
                        .Div()
                            .Div()
                                .A(e => e.Href("javascript:void(0);").Onclick(onclick))
                                    .Text(HttpUtility.HtmlEncode(Controller.GetResourceString("Upload_File", "Upload File")))
                                .EndTag()
                            .EndTag()
                            .Div(e => e.Display("none"))
                                .A(e => e.Href("javascript:void(0);").Onclick(onclick))
                                    .Text(HttpUtility.HtmlEncode(Controller.GetResourceString("Upload_Another_File", "Upload Another File")))
                                .EndTag()
                            .EndTag()
                        .EndTag()
                    .EndTag()
                    .Div(e => e.Float(right).Visibility("hidden"))
                        .Input(e => e
                            .Attr(HtmlTextWriterAttribute.Type, "button")
                            .Attr(HtmlTextWriterAttribute.Onclick, Page.ClientScript.GetPostBackEventReference(this, "Upload"))
                            .Attr(HtmlTextWriterAttribute.Value, Controller.GetResourceString("Submit", "Submit")))
                        .EndTag()
                    .EndTag()
                    .Div(e => e.Clear("both")).EndTag()
                .EndTag();
        }
开发者ID:italiazhuang,项目名称:wx_ptest,代码行数:32,代码来源:FileManager.cs

示例3: Render

        protected override void Render(HtmlTextWriter writer)
        {
            if (DesignMode)
            {
                writer.Write(String.Format(System.Globalization.CultureInfo.InvariantCulture,
                "<div><table width=\"{0}\" height=\"{1}\" bgcolor=\"#f5f5f5\" bordercolor=\"#c7c7c7\" cellpadding=\"0\" cellspacing=\"0\" border=\"1\"><tr><td valign=\"middle\" align=\"center\">IZWebFileManager - <b>{2}</b></td></tr></table></div>",
                    Width,
                    Height,
                    ID));
                return;
            }

            AddAttributesToRender(writer);
            RenderBeginOuterTable(writer);
            if (ShowAddressBar)
                RenderAddressBar(writer);
            if (ShowToolBar)
                RenderToolBar(writer);

            writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0");
            writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
            writer.RenderBeginTag(HtmlTextWriterTag.Table);
            writer.RenderBeginTag(HtmlTextWriterTag.Tr);
            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            RenderFolderTree(writer);

            writer.RenderEndTag();

            // splitter
            writer.AddStyleAttribute(HtmlTextWriterStyle.Cursor, "col-resize");
            writer.AddAttribute("onmousedown", ClientID + "SplitterDragStart(event)");
            writer.AddAttribute("onselectstart", "return false");
            writer.RenderBeginTag(HtmlTextWriterTag.Td);
            if (SplitterImageUrl.Length > 0)
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Src, ResolveClientUrl(SplitterImageUrl));
            }
            else
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Width, "3px");
                writer.AddAttribute(HtmlTextWriterAttribute.Height, "3px");
                writer.AddAttribute(HtmlTextWriterAttribute.Src, Page.ClientScript.GetWebResourceUrl(typeof(FileManagerController), "IZ.WebFileManager.resources.Empty.gif"));
            }
            writer.AddAttribute(HtmlTextWriterAttribute.Alt, "");
            writer.RenderBeginTag(HtmlTextWriterTag.Img);
            writer.RenderEndTag();
            writer.RenderEndTag();

            writer.RenderBeginTag(HtmlTextWriterTag.Td);

            RenderFileView(writer);

            writer.RenderEndTag();
            writer.RenderEndTag();
            writer.RenderEndTag();

            if (ShowFileUploadBar)
                RenderFileUploadBar(writer);
            RenderEndOuterTable(writer);

            var style = new Style();
            style.CopyFrom(ControlStyle);
            style.Width = Unit.Empty;
            style.Height = Unit.Empty;

            writer.Div(attr => attr.Id(ClientID + "_SelectFolderPanel").Position("fixed").Display("none").ZIndex(100).BackgroundColor("rgba(0,0,0, 0.2)").Style("filter", "progid:DXImageTransform.Microsoft.gradient(startColorstr=#33000000,endColorstr=#33000000)"))
                .Div(attr => attr.Style(style).Display("inline-block").Position("relative").Left("30%").Top("10%").Padding(2).Direction(Controller.IsRightToLeft))
                    .Div(attr => attr.Padding(5))
                        .Text(GetResourceString("SelectDestination", "Select destination directory"), true)
                    .EndTag()
                    .RenderControl(_selectFolderTree)
                    .Div(attr => attr.Align(Controller.IsRightToLeft ? "left" : "right"))
                        .Button(attr => attr.Id(ClientID + "_SelectFolderOK").Attr("type", "button"))
                            .Text(GetResourceString("Select", "Select"), true)
                        .EndTag()
                        .Button(attr => attr.Id(ClientID + "_SelectFolderCancel").Attr("type", "button"))
                            .Text(GetResourceString("Cancel", "Cancel"), true)
                        .EndTag()
                    .EndTag()
                .EndTag()
            .EndTag();
        }
开发者ID:Jeff-Tian,项目名称:IZWebFileManager,代码行数:83,代码来源:FileManager.cs

示例4: RenderContextMenuPopupItem

 void RenderContextMenuPopupItem(HtmlTextWriter writer, MenuItem menuItem, int index)
 {
     if (menuItem.Text == "__separator__")
     {
         writer
             .Div(e => e.BackgroundColor(ColorTranslator.ToHtml(Controller.DynamicMenuStyle.BorderColor)).Height(Controller.DynamicMenuStyle.BorderWidth).Width("100%").Cursor("default"))
             .EndTag();
     }
     else
     {
         writer
             .Table(e =>
                        {
                            e.Cellpadding(0).Cellspacing(0).Border(0).Width("100%").Cursor("default").Id(ClientID + "CMD" + menuItem.Value);
                            if (menuItem.Enabled)
                                e.Onclick(menuItem.NavigateUrl);
                            else
                                e.Color("gray");
                            return e;
                        })
                 .Tr()
                     .Td()
                         .Img(e => e.Id(ClientID + "CMIMG" + menuItem.Value).Width(16).Height(16)
                             .Src(String.IsNullOrEmpty(menuItem.ImageUrl) ? Page.ClientScript.GetWebResourceUrl(typeof(FileManagerController), "IZ.WebFileManager.resources.Empty.gif"): ResolveClientUrl(menuItem.ImageUrl)))
                         .EndTag()
                     .EndTag()
                     .Td(e => e.WhiteSpace("nowrap").PaddingLeft(2).PaddingRight(2).Width("100%"))
                         .Text("&nbsp;" + menuItem.Text)
                     .EndTag()
                     .Td()
                         .Img(e => e.Height(16).Width(16)
                             .Src(menuItem.ChildItems.Count == 0 ? 
                                 Page.ClientScript.GetWebResourceUrl(typeof(FileManagerController), "IZ.WebFileManager.resources.Empty.gif") : 
                                 (Controller.IsRightToLeft ? 
                                     Page.ClientScript.GetWebResourceUrl(typeof(FileManagerController), "IZ.WebFileManager.resources.PopOutRtl.gif"):
                                     Page.ClientScript.GetWebResourceUrl(typeof(FileManagerController), "IZ.WebFileManager.resources.PopOut.gif"))))
                         .EndTag()
                     .EndTag()
                 .EndTag()
             .EndTag();
     }
 }
开发者ID:Jeff-Tian,项目名称:IZWebFileManager,代码行数:42,代码来源:FileView.cs


注:本文中的System.Web.UI.HtmlTextWriter.Div方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。