Exemplo n.º 1
0
        public DictionaryBlock <string, long> GetMostValuedLabels(int startIndex, int count)
        {
            ListBlock <Label> labels;

            try
            {
                labels = LabelDao.ListAllRated(startIndex, count);
            }
            catch (InstanceNotFoundException <Label> )
            {
                return(new DictionaryBlock <string, long>(startIndex, false));
            }
            catch (NoMoreItemsException <Label> )
            {
                return(new DictionaryBlock <string, long>(startIndex, false));
            }

            DictionaryBlock <string, long> details = new DictionaryBlock <string, long>(labels.Index, labels.HasMore);

            foreach (Label label in labels)
            {
                int rating = RatingDao.CalculateValueForLabel(label.text);

                details.Add(label.text, rating);
            }

            return(details);
        }
Exemplo n.º 2
0
 public List <Label> FindAllLabels()
 {
     return(LabelDao.ListAllRated(0, 1000));
 }