本文整理汇总了C#中Cloud.HTML方法的典型用法代码示例。如果您正苦于以下问题:C# Cloud.HTML方法的具体用法?C# Cloud.HTML怎么用?C# Cloud.HTML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cloud
的用法示例。
在下文中一共展示了Cloud.HTML方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadTagCloud
private void LoadTagCloud()
{
const string cacheName = "ArticleTagCloud";
string htmlCloud;
if (HttpRuntime.Cache[cacheName] == null)
{
var cloud1 = new Cloud
{
DataIDField = "keyword_id",
DataKeywordField = "keyword_value",
DataCountField = "keyword_count",
DataURLField = "keyword_url"
};
DataSet theDs = Contents.GetContentTagsAll();
cloud1.DataSource = theDs;
cloud1.MinFontSize = 14;
cloud1.MaxFontSize = 30;
cloud1.FontUnit = @"px";
htmlCloud = cloud1.HTML();
HttpRuntime.Cache.AddObjToCache(htmlCloud, cacheName);
}
else
{
htmlCloud = (string) HttpRuntime.Cache[cacheName];
}
ViewBag.CloudTags = htmlCloud;
}
示例2: Filter
public ActionResult Filter(string firstLetter)
{
_chosen = Convert.ToChar(firstLetter);
ViewBag.FirstLetter = firstLetter.ToUpper();
var cloud1 = new Cloud
{
DataIDField = @"keyword_id",
DataKeywordField = "keyword_value",
DataCountField = "keyword_count",
DataURLField = "keyword_url"
};
DataSet theDs = firstLetter == "0"
? Artists.GetArtistCloudByNonLetter()
: Artists.GetArtistCloudByLetter(firstLetter);
cloud1.DataSource = theDs;
cloud1.MinFontSize = 14;
cloud1.MaxFontSize = 30;
cloud1.FontUnit = "px";
foreach (char chl in _letters.Where(chl => chl == Convert.ToChar(firstLetter)))
{
_chosen = chl;
}
var sb = new StringBuilder();
sb.Append(@"<div class=""letter_group""><ul>");
foreach (char ch2 in _letters)
{
sb.Append("<li>");
if (Convert.ToChar(ch2.ToString(CultureInfo.InvariantCulture).ToLower()) ==
Convert.ToChar(_chosen.ToString(CultureInfo.InvariantCulture).ToLower()))
{
sb.Append("<b>");
sb.Append(ch2);
sb.Append("</b>");
}
else
{
sb.AppendFormat(@"<a href=""{0}"">{1}</a>", VirtualPathUtility.ToAbsolute(
string.Format("~/video/bands/{0}",
Convert.ToChar(ch2.ToString(CultureInfo.InvariantCulture).ToLower()))),
Convert.ToChar(ch2.ToString(CultureInfo.InvariantCulture)));
}
sb.Append("</li>");
}
sb.Append("</ul></div>");
ViewBag.LetterOfBands = sb.ToString();
ViewBag.CloudBands = cloud1.HTML();
return View();
}