本文整理汇总了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;
}
}
示例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();
}
}
}
示例3: WriteSeparator
private void WriteSeparator(HtmlTextWriter writer) {
if (singleParagraph) {
writer.Write(" ");
}
else {
writer.WriteBreak();
}
}
示例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();
}
示例5: WriteBreakIfPresent
private void WriteBreakIfPresent(HtmlTextWriter writer, String text) {
if (text == breakTag) {
if (EnableLegacyRendering) {
writer.WriteObsoleteBreak();
}
else {
writer.WriteBreak();
}
}
else {
writer.Write(text);
}
}