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