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


C# Cloud.HTML方法代码示例

本文整理汇总了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;
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:33,代码来源:NewsController.cs

示例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();
        }
开发者ID:dasklub,项目名称:kommunity,代码行数:62,代码来源:VideoController.cs


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