private List <Collector> GetCollectorListPage(long surveyId, int page, int pageSize, bool limitPageSize, GetCollectorListSettings settings) { RequestSettings parameters = settings.Serialize(); parameters.Add("survey_id", surveyId.ToString()); parameters.Add("page", page); if (limitPageSize) { parameters.Add("page_size", pageSize); } return(GetCollectorListRequest(parameters)); }
//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.Serialize(); 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); }