메서드 복사
복사 대상(T[], Int32)
지정된 인덱스에서 시작하여 지정된 배열에 IQueue 요소를 복사합니다.
선언
void CopyTo(T[] array, int arrayIndex)
파라미터
| 타입 | 이름 | 기술설명 |
|---|---|---|
| 티[] | 정렬 | IQueue에서 복사된 요소의 대상 배열입니다. |
| 시스템.Int32 | 배열 인덱스 | 복사가 시작되는 배열의 XNUMX부터 시작하는 인덱스입니다. |
예
다음 코드 샘플은 전체 소스 대기열을 복사하는 방법을 보여줍니다. 0번째 인덱스부터 대상 배열로 이동합니다.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string dataTypeName = "DistributedQueue";
IDistributedQueue<Product> queue = cache.DataTypeManager.GetQueue<Product>(dataTypeName);
Product[] products = new Product[queue.Count];
queue.CopyTo(products, 0);