本文整理汇总了C#中IdList.Any方法的典型用法代码示例。如果您正苦于以下问题:C# IdList.Any方法的具体用法?C# IdList.Any怎么用?C# IdList.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IdList
的用法示例。
在下文中一共展示了IdList.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderResults
public static void RenderResults(HtmlWriter writer, SearchRecord[] records, bool renderUl = true)
{
var visibleCategorizations = CategorizationFolder.GetVisibleCategorizations();
var newsListUrl = Urls.GetMainNewsListUrl();
if (renderUl)
writer.RenderBeginTag(HtmlTextWriterTag.Ul, "news-list");
foreach (var record in records)
{
var date = record.GetDate("date");
writer.RenderBeginTag(HtmlTextWriterTag.Li, "clearfix");
writer.RenderBeginTag(HtmlTextWriterTag.Div);
writer.AddAttribute(HtmlTextWriterAttribute.Href, record.GetString("url"));
writer.RenderBeginTag(HtmlTextWriterTag.A);
writer.RenderFullTag(HtmlTextWriterTag.H3, record.GetString("title"));
writer.RenderEndTag(); // a
if (date != null)
writer.RenderFullTag(HtmlTextWriterTag.Span,
"Publiseret " + record.GetDate("date").Value.ToString("dd-MM-yyyy"), "date");
var categorizations = new IdList(record.GetString("categorizations"));
if (categorizations.Any())
{
RenderCategorizations(writer, categorizations, visibleCategorizations, newsListUrl);
}
writer.RenderBeginTag(HtmlTextWriterTag.A);
var text = record.GetString("summary");
if (text.Length > 150)
text = text.Substring(0, 150);
writer.RenderFullTag(HtmlTextWriterTag.P, text);
writer.RenderEndTag(); // a
writer.RenderEndTag(); // div
writer.RenderEndTag(); // li.clearfix
}
if (renderUl)
writer.RenderEndTag();
}