0

How can I cancel Task<> from async methods in Dropbox C# SDK?
I don't see how I can set CancellationToken for them. I thought there is something like it in API methods:

public Task<Metadata> GetMetadataAsync(
    string path,
    bool includeMediaInfo = false,
    bool includeDeleted = false,
    bool includeHasExplicitSharedMembers = false,
    CancellationToken ct = null /*This is would be optional cancellation token. But this parameter doesn't exist in API*/
);

But can't find it. It would be good approach for cancel asynchronous operation.

23W
  • 1,413
  • 18
  • 37
  • 1
    You don't know how to create the CancellationToken, is this your problem? – Rodrigo Vedovato May 15 '17 at 13:27
  • @RodrigoVedovato, My problem is how to set CancellationToken to Dropbox C# SDK. It's important for cancel API awaiting task. Look [How do I cancel non-cancelable async operations?](https://blogs.msdn.microsoft.com/pfxteam/2012/10/05/how-do-i-cancel-non-cancelable-async-operations/) – 23W May 15 '17 at 15:36
  • @Hakam Fostok, Thank you for good redaction of my ask. – 23W May 15 '17 at 15:44
  • 1
    [Cross-linking for reference: https://www.dropboxforum.com/t5/API-support/CancellationToken/m-p/220956#M11721 ] – Greg May 15 '17 at 18:41

1 Answers1

0

Greg's answer:

The Dropbox API v2 .NET SDK doesn't support cancelling/cancellation tokens, but I'll be sure to pass this along as a feature request.

23W
  • 1,413
  • 18
  • 37