You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With DismProgressAsync is the same as DismProgress without cancellation
If the task result is bool==true reboot are required.
with that the library customer can do:
class MyprogressReporter :iProgress<DismProgressAsync>{publicvoid Report (DismProgressAsyncvalue){// update the UI}
...}
...
var progress=new MyprogressReporter();CancellationTokenSourcesource=new CancellationTokenSource();vartsk= EnableFeatureByPackageNameAsync(session,"myfeature",string.Empty,false,true,newList<string>(), source.Token, progress);//if the user want to cancel
source.Cancel()//Or after a delay
source.CancelAfter(delay);// Or wait for the resultboolrebootRequired=await tsk;
It's easily implementable with TaskCompletionSource.
I hope I did not make any mistakes.
Thank you for your library.
The text was updated successfully, but these errors were encountered:
This sounds interesting. Does wrapping the call in a Task.Run() give you the same result? I'd be happy to accept any contributions that add async functionality if you have time.
@mveril I understand the nature of your request, but I don't believe this is appropriate as it is not "async all the way down." That is, the DISM API is not truly asynchronous, and so providing asynchronous APIs to wrap it (via this library) isn't faithful.
I would instead encourage you to wrap calls in Task.Run() as @jeffkl mentioned; you could, as you mentioned, set it up to return a Task, for example:
Task<bool> t = Task.Run(() => { return EnableFeatureByPackageName(); })
Hello
Can you add an async version of DISM api.
For example with EnableFeatureByPackageNameAsync:
With DismProgressAsync is the same as DismProgress without cancellation
If the task result is
bool==true
reboot are required.with that the library customer can do:
It's easily implementable with TaskCompletionSource.
I hope I did not make any mistakes.
Thank you for your library.
The text was updated successfully, but these errors were encountered: