c#2016. 7. 6. 13:41

Linq가 없는 시절  페이징 할려면 


private List<Data> MakePhotoList(int startCount)
{
var tempPhotoList = new List<Data>();
int maxCount = startCount + 9;
for (int i = startCount; startCount < maxCount; startCount++)
{
tempPhotoList.Add(_photoList[i]);
}
return tempPhotoList;
}


이런식으로 해야만 했다.

하지만 Linq가 있으면

_photoList.Skip(startCount).Take(9).ToList();

한줄로 끝~


'c#' 카테고리의 다른 글

사용하지 않을 메소드앞에 [Obsolete] 어트리뷰트 사용  (0) 2020.01.03
list 삭제  (0) 2019.08.02
URI Parameter 붙이기  (0) 2016.06.20
RenderTargetBitmap Memory Leak 해결  (0) 2016.04.20
Simple Uniq ID만들기  (0) 2016.04.20
Posted by 동동(이재동)
iPhone App2011. 8. 19. 17:19

으아~~

쓴거 다 날라갔다 힘들게 썻는데

참고한곳 : http://blog.keyoptions.co/tableview-with-automatic-load-more

참조한곳 소스: 


내가 수정한 소스 



Posted by 동동(이재동)