Beispiel #1
0
        public string GetLinkItemClassName(TagCloudItem item)
        {
            int itemCount = Items.Count;

            if (maxRank == MaxSize && minRank == MinSize)
            {
                return(string.Concat(BaseLinkClassName, item.Weight));
            }

            int normalizedRank = 1 + (item.Weight - minRank) *
                                 (MaxSize - 1) / (maxRank - minRank);


            return(string.Concat(BaseLinkClassName, normalizedRank));
        }
Beispiel #2
0
 public void AddItem(TagCloudItem item)
 {
     _Items.Add(item);
     minRank = _Items.Min(x => x.Weight);
     maxRank = _Items.Max(x => x.Weight);
 }