중첩 된 제네릭 매개 변수 IList의 <IList의 <object >> 매개 변수를 전달하는 방법

타사 라이브러리를 호출 할 때 아래와 같이, 같은 일반적인 매개 변수는있다 :

 

 

경험에 따르면, 두 개의 중첩 된 목록의 사용은 변수를 선언 할 수 있습니다 :

IList의 <IList의 <AnnotatedPoint2D >> outImageGrid2 = 새로운 목록 <일람 <AnnotatedPoint2D >> ();

// 여기에 컴파일러 오류에 힌트 : 암시 적으로 변환 할 수 없습니다 .

마지막으로, stackflow에서 해결책을 찾을 수 :

IList의 <IList의 <AnnotatedPoint2D >> outImageGrid2 = 새로운 목록 < IList의 <AnnotatedPoint2D >> ();

 

추천

출처www.cnblogs.com/liangxiarong/p/11824376.html