private static void CopyPhotosWithoutGPS() { while (photoQueueWithoutGPS.Count > 0) { PhotoMetadata meta; if (photoQueueWithoutGPS.TryDequeue(out meta)) { GoogleAddressInfo address; if (TripSpanCache.TryGetAddress(meta, out address)) { meta.Address = address; } GenerateNewFilePath(meta); CopyPhoto(meta); } } }
private static void CopyPhotosWithoutGPSTask() { while (photoWithGPSInProgress) { PhotoMetadata meta; if (photoQueueWithoutGPS.TryPeek(out meta)) { GoogleAddressInfo address; if (TripSpanCache.TryGetAddress(meta, out address)) { meta.Address = address; GenerateNewFilePath(meta); CopyPhoto(meta); photoQueueWithoutGPS.TryDequeue(out meta); } } Task.Delay(500); } }