예제 #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);
        }
예제 #2
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));
        }
예제 #3
0
 public void AddItem(TagCloudItem item)
 {
     _Items.Add(item);
     minRank = _Items.Min(x => x.Weight);
     maxRank = _Items.Max(x => x.Weight);
 }
예제 #4
0
 public void AddItem(TagCloudItem item)
 {
     _Items.Add(item);
     minRank = _Items.Min(x => x.Weight);
     maxRank = _Items.Max(x => x.Weight);
 }