本文整理汇总了C#中System.Web.UI.HtmlTextWriter.EnterStyle方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTextWriter.EnterStyle方法的具体用法?C# HtmlTextWriter.EnterStyle怎么用?C# HtmlTextWriter.EnterStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlTextWriter
的用法示例。
在下文中一共展示了HtmlTextWriter.EnterStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteLinkAttachment
private void WriteLinkAttachment(string name, string link, string caption, string description, HtmlTextWriter output) {
output.Write("<div style=\"margin-left:10px\">");
WriteLink(name, link, output);
output.Write("<br />");
//html += FormatLink(name, link, output) + "<br />";
output.EnterStyle(AttachmentStyle);
output.Write(caption);
output.Write("<br />");
output.Write(description);
output.ExitStyle(AttachmentStyle);
output.Write("</div>");
//html += "<span class=\"LikeBox_Attachment\">" + caption + "</span><br />";
//html += "<span class=\"LikeBox_Attachment\">" + description + "</span><br />";
//html += "</div>";
}
示例2: OutputFeed
private void OutputFeed(HtmlTextWriter output) {
string Posts = Helpers.WebResponseHelper.GetWebResponse(String.Format("https://graph.facebook.com/{0}/posts?{1}", FacebookID, _Limit != null ? "limit=" + _Limit.ToString() : ""));
JsonObject PostJO = new JsonObject(Posts);
JsonArray PostJA = (JsonArray)PostJO["data"];
output.Write(String.Format("<div style=\"width:100%; height:{0}px; overflow:scroll; overflow-x:hidden;\">", _FeedHeight));
output.Write(String.Format("<div style=\"padding:{0}px\">", _Padding));
for (int i = 0; i < PostJA.JsonObjects.Count; i++) {
JsonObject Post = PostJA.JsonObjects[i];
JsonObject From = (JsonObject)Post["from"];
if ((string)From["id"] == FacebookPage.id) {
if (ShowTitleInFeed) {
WriteLink(FacebookPage.name, FacebookPage.link, output);
output.Write(" ");
}
output.Write((string)Post["message"] + "<br />");
if ((string)Post["picture"] != null) output.Write(String.Format("<img src=\"{0}\" style=\"margin-left:10px\"/><br />", Post["picture"]));
if ((string)Post["type"] == "link") WriteLinkAttachment((string)Post["name"], (string)Post["link"], (string)Post["caption"], (string)Post["description"],output);
DateTime date = Helpers.Generic.RFC3339ToDateTime((string)Post["created_time"]);
output.EnterStyle(DateStyle);
output.Write(date.Add(UTCOffset).ToString(DateFormatString));
output.ExitStyle(DateStyle);
}
if (i != PostJA.JsonObjects.Count - 1) output.Write("<hr />");
}
output.Write("</div>");
output.Write("</div>");
//output.Write(JsonHelper.JsonToHtml(PostJO));
}
示例3: WriteLink
private void WriteLink(string name, string href, HtmlTextWriter output) {
output.AddAttribute("href", href);
output.EnterStyle(LinkStyle,HtmlTextWriterTag.A);
output.Write(name);
output.ExitStyle(LinkStyle,HtmlTextWriterTag.A);
}
示例4: OutputHeader
private void OutputHeader(HtmlTextWriter output) {
string ImgUrl = Helpers.WebResponseHelper.GetWebResponseRedirectURL(String.Format("https://graph.facebook.com/{0}/picture", FacebookID));
HtmlTextWriter H = new HtmlTextWriter(output.InnerWriter);
H.AddStyleAttribute(HtmlTextWriterStyle.BackgroundColor, "#DFF1FF");
HeaderStyle.AddAttributesToRender(H);
H.AddStyleAttribute(HtmlTextWriterStyle.Width, "100%");
H.RenderBeginTag(HtmlTextWriterTag.Div);
H.Write(String.Format("<div style=\"padding:{0}px\">",_Padding)+
"<table><tr>");
if (ShowLogo) H.Write(String.Format("<td><img src=\"{0}\" alt=\"\"/></td>", ImgUrl));
H.Write("<td style=\"width:100%\">");
Style DefaultHeaderCaptionStyle = new Style();
DefaultHeaderCaptionStyle.Font.Size = FontUnit.Parse("150%");
HeaderCaptionStyle.MergeWith(LinkStyle);
HeaderCaptionStyle.MergeWith(DefaultHeaderCaptionStyle);
H.AddAttribute("href", FacebookPage.link);
H.EnterStyle(HeaderCaptionStyle, HtmlTextWriterTag.A);
//WriteLink((string)MetadataJO["name"], (string)MetadataJO["link"], H);
H.Write(FacebookPage.name);
H.ExitStyle(HeaderCaptionStyle, HtmlTextWriterTag.A);
H.Write(" on Facebook");
H.Write("</td></tr></table></div>");
H.RenderEndTag();
}