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


C# HtmlTextWriter.WriteBreak方法代码示例

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


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

示例1: RenderBulletText

 // Writes the text of each bullet according to the list's display mode.
 protected virtual void RenderBulletText (ListItemCollection items, int index, HtmlTextWriter writer) {
     switch (Control.DisplayMode) {
         case BulletedListDisplayMode.Text:
             writer.WriteEncodedText(items[index].Text);
             writer.WriteBreak();
             break;
         case BulletedListDisplayMode.HyperLink:
             // 
             string targetURL = Control.ResolveClientUrl(items[index].Value);
             if (items[index].Enabled) {
                 PageAdapter.RenderBeginHyperlink(writer, targetURL, true /* encode */, items[index].Text);
                 writer.Write(items[index].Text);
                 PageAdapter.RenderEndHyperlink(writer);
             } else {
                 writer.WriteEncodedText(items[index].Text);
             }
             writer.WriteBreak();
             break;
         case BulletedListDisplayMode.LinkButton:
             if (items[index].Enabled) {
                 // 
                 PageAdapter.RenderPostBackEvent(writer, Control.UniqueID, index.ToString(CultureInfo.InvariantCulture),
                                                     items[index].Text, items[index].Text);
             } else {
                 writer.WriteEncodedText(items[index].Text);
             }
             writer.WriteBreak();
             break;
         default:
             Debug.Assert(false, "Invalid BulletedListDisplayMode");
             break;
     }
 }
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:34,代码来源:WmlBulletedListAdapter.cs

示例2: Render

 protected internal override void Render(HtmlTextWriter writer) {
     if (Control.HotSpots.Count > 0) {
         HotSpotMode mapMode = Control.HotSpotMode;
         if (mapMode == HotSpotMode.NotSet) {
             mapMode = HotSpotMode.Navigate;
         }
         HotSpotMode spotMode;
         int hotSpotIndex = 0;
         string targetURL;
         string text;
         foreach (HotSpot item in Control.HotSpots) {
             text = item.AlternateText;
             if (text != null && text.Length == 0) {
                 text = item.NavigateUrl;
             }
             spotMode = item.HotSpotMode;
             if (spotMode == HotSpotMode.NotSet) {
                 spotMode = mapMode;
             }
             if (spotMode == HotSpotMode.PostBack) {
                 PageAdapter.RenderPostBackEvent(writer, Control.ClientID, hotSpotIndex.ToString(CultureInfo.InvariantCulture),
                                                 null, text);
             }
             else if (spotMode == HotSpotMode.Navigate) {
                 targetURL = Control.ResolveClientUrl(item.NavigateUrl);
                 targetURL = Control.GetCountClickUrl(targetURL);
                 PageAdapter.RenderBeginHyperlink(writer, targetURL, true /* encode */, null, Control.AccessKey);
                 writer.Write(text);
                 PageAdapter.RenderEndHyperlink(writer);
             }
             else { //HotSpotMode.Inactive
                 writer.Write(LiteralControlAdapterUtility.ProcessWmlLiteralText(text));
             }
             ++hotSpotIndex;
             writer.WriteBreak();
         }
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:38,代码来源:WmlImageMapAdapter.cs

示例3: WriteSeparator

 private void WriteSeparator(HtmlTextWriter writer) {
     if (singleParagraph) {
         writer.Write(" ");
     }
     else {
         writer.WriteBreak();
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:8,代码来源:WmlValidationSummaryAdapter.cs

示例4: ShowUpdateForm

        /// <summary>
        /// Generates a SPARQL Update Form
        /// </summary>
        /// <param name="context">HTTP Context</param>
        protected virtual void ShowUpdateForm(HttpContext context)
        {
            //Set Content Type
            context.Response.Clear();
            context.Response.ContentType = "text/html";

            //Get a HTML Text Writer
            HtmlTextWriter output = new HtmlTextWriter(new StreamWriter(context.Response.OutputStream));

            //Page Header
            output.Write("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">");
            output.RenderBeginTag(HtmlTextWriterTag.Html);
            output.RenderBeginTag(HtmlTextWriterTag.Head);
            output.RenderBeginTag(HtmlTextWriterTag.Title);
            output.WriteEncodedText("SPARQL Update Interface");
            output.RenderEndTag();
            //Add Stylesheet
            if (!this._config.Stylesheet.Equals(String.Empty))
            {
                output.AddAttribute(HtmlTextWriterAttribute.Href, this._config.Stylesheet);
                output.AddAttribute(HtmlTextWriterAttribute.Type, "text/css");
                output.AddAttribute(HtmlTextWriterAttribute.Rel, "stylesheet");
                output.RenderBeginTag(HtmlTextWriterTag.Link);
                output.RenderEndTag();
            }
            output.RenderEndTag();


            //Header Text
            output.RenderBeginTag(HtmlTextWriterTag.Body);
            output.RenderBeginTag(HtmlTextWriterTag.H3);
            output.WriteEncodedText("SPARQL Update Interface");
            output.RenderEndTag();

            //Query Form
            output.AddAttribute(HtmlTextWriterAttribute.Name, "sparqlUpdate");
            output.AddAttribute("method", "get");
            output.AddAttribute("action", context.Request.Path);
            output.RenderBeginTag(HtmlTextWriterTag.Form);

            if (!this._config.IntroductionText.Equals(String.Empty))
            {
                output.RenderBeginTag(HtmlTextWriterTag.P);
                output.Write(this._config.IntroductionText);
                output.RenderEndTag();
            }

            output.WriteEncodedText("Update");
            output.WriteBreak();
            output.AddAttribute(HtmlTextWriterAttribute.Name, "update");
            output.AddAttribute(HtmlTextWriterAttribute.Rows, "15");
            output.AddAttribute(HtmlTextWriterAttribute.Cols, "100");
            output.RenderBeginTag(HtmlTextWriterTag.Textarea);
            output.WriteEncodedText(this._config.DefaultUpdate);
            output.RenderEndTag();
            output.WriteBreak();

            //output.WriteEncodedText("Default Graph URI: ");
            //output.AddAttribute(HtmlTextWriterAttribute.Name, "default-graph-uri");
            //output.AddAttribute(HtmlTextWriterAttribute.Type, "text");
            //output.AddAttribute(HtmlTextWriterAttribute.Size, "100");
            //output.AddAttribute(HtmlTextWriterAttribute.Value, this._config.DefaultGraphURI);
            //output.RenderBeginTag(HtmlTextWriterTag.Input);
            //output.RenderEndTag();
            //output.WriteBreak();

            output.AddAttribute(HtmlTextWriterAttribute.Type, "submit");
            output.AddAttribute(HtmlTextWriterAttribute.Value, "Perform Update");
            output.RenderBeginTag(HtmlTextWriterTag.Input);
            output.RenderEndTag();

            output.RenderEndTag(); //End Form

            //End of Page
            output.RenderEndTag(); //End Body
            output.RenderEndTag(); //End Html

            output.Flush();
        }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:83,代码来源:BaseSparqlUpdateHandler.cs

示例5: WriteBreakIfPresent

 private void WriteBreakIfPresent(HtmlTextWriter writer, String text) {
     if (text == breakTag) {
         if (EnableLegacyRendering) {
             writer.WriteObsoleteBreak();
         }
         else {
             writer.WriteBreak();
         }
     }
     else {
         writer.Write(text);
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:13,代码来源:ValidationSummary.cs


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