Closed DavidBarishev closed 8 years ago
First of all, do not use asyncMethod().Result
. Asynchronous tasks must not be waited on main UI thread.
Instead, you have to use as follow...
someButton.Click += async (s,e) => {
try{
VideoConverter vc = new VideoConverter();
File x = await vc.ConvertFile(BaseContext,
new File(filename),
(msg) => System.Diagnostics.Debug.WriteLine(msg) ,
(d,y) => System.Diagnostics.Debug.WriteLine("{0} {1}",d,y));
// do something with file...
}catch(Exception ex){
// display an error...
}
};
That did it, thanks!
Hello! I Hope this repository isn't dead, it a very useful one. I have been trying to test if its working, and i cant seem to get the code to run.
Here is the code in the UI thread:
I pasted the code on the readme file to another one and edited it a bit to get it compiling.
Am im doing something wrong ? I'm trying to convert a mp4 file to mp3.I am not so familiar with async, so it might be it, but i'm not getting any output. The debugger never prints anything.