protected async Task <IEnumerable <TRemoteFile> > GetFindResults(int findId) { var results = new List <TRemoteFile>(); ISourceFile sourceFile = default(ISourceFile); while (true) { int findStatus = FindNext(findId, ref sourceFile); if (findStatus == HikConst.NET_DVR_ISFINDING) { await Task.Delay(500); } else if (findStatus == HikConst.NET_DVR_FILE_SUCCESS) { results.Add((TRemoteFile)sourceFile.ToRemoteFile()); } else { break; } } return(results); }