var task = new TaskCompletionSource<string>();
Interop.MediaInformation.MediaThumbnailCompletedCallback thumbnailResult = (MediaContentError createResult, string path, IntPtr userData) =>
{
- MediaContentValidator.ThrowIfError(createResult, "Failed to create thumbnail");
+ if (createResult != MediaContentError.None)\r
+ {\r
+ task.SetException(new InvalidOperationException("Failed to create thumbnail:" + createResult));\r
+ }
+
task.SetResult(path);
};
MediaContentValidator.ThrowIfError(
Interop.MediaInformation.MediaThumbnailCompletedCallback thumbnailResult = (MediaContentError createResult, string path, IntPtr userData) =>
{
- MediaContentValidator.ThrowIfError(createResult, "Failed to create thumbnail");
+ if (createResult != MediaContentError.None)\r
+ {\r
+ task.SetException(new InvalidOperationException("Failed to create thumbnail:" + createResult));\r
+ }
+
task.SetResult(path);
};