Пример #1
0
 ///No limit on page size
 public List<Collector> GetCollectorList(long surveyId, int page, GetCollectorListSettings settings)
 {
     if (page < 1)
     {
         throw new ArgumentException("Page must be greater than 0.");
     }
     return GetCollectorListPage(surveyId, page, 0, false, settings);
 }
Пример #2
0
 //Auto-paging
 public List<Collector> GetCollectorList(long surveyId, GetCollectorListSettings settings)
 {
     var collectors = new List<Collector>();
     bool cont = true;
     int page = 1;
     while (cont)
     {
         RequestSettings parameters = settings.Serialized;
         parameters.Add("survey_id", surveyId.ToString());
         parameters.Add("page", page);
         var newCollectors = GetCollectorListRequest(parameters);
         if (newCollectors.Count > 0)
         {
             collectors.AddRange(newCollectors);
         }
         if (newCollectors.Count < 1000)
         {
             cont = false;
         }
         page++;
     }
     return collectors;
 }
 public List <Collector> GetCollectorList(long surveyId, GetCollectorListSettings settings)
 {
     return(GetCollectorListPager(surveyId, settings));
 }
        public List <Collector> GetCollectorList(long surveyId)
        {
            var settings = new GetCollectorListSettings();

            return(GetCollectorListPager(surveyId, settings));
        }
Пример #5
0
 private List<Collector> GetCollectorListPage(long surveyId, int page, int pageSize, bool limitPageSize, GetCollectorListSettings settings)
 {
     RequestSettings parameters = settings.Serialized;
     parameters.Add("survey_id", surveyId.ToString());
     parameters.Add("page", page);
     if (limitPageSize)
     {
         parameters.Add("page_size", pageSize);
     }
     return GetCollectorListRequest(parameters);
 }
Пример #6
0
 //Limit the page size returned
 public List<Collector> GetCollectorList(long surveyId, int page, int pageSize, GetCollectorListSettings settings)
 {
     if (pageSize < 1 || pageSize > 1000)
     {
         throw new ArgumentException("Page size must be between 1 and 1000.");
     }
     return GetCollectorListPage(surveyId, page, pageSize, true, settings);
 }