This project is read-only.

Extending ReportProgressEvent with custom object

Jun 27, 2012 at 4:40 PM

Hello,

really awesome lib. But it would be useful to add some custom types to the ProgressChanged Event... So that you can track what has changed.

I can't get it done - maybe it is also interesting for you?

 

Would be nice to hear from you,

thanks

Norbert

Jul 6, 2012 at 1:27 AM

Hi Norbert,

Initially I wanted to cover the most general scenario with progress reported as percentage. I can imagine that this solution is too restrictive for some cases like passing textual description of steps that are being executed. Although I would like to keep AsynFunc class as it is I think that I could add a new class to the family to match your needs.

It will be called AsyncFuncWithProgress. With my current workload I should be able to code it during next weekend.

Thanks,

Stan

Aug 14, 2012 at 1:43 PM
Edited Aug 14, 2012 at 1:50 PM

Hi, what's the status on this? AsyncFunc is amazing, The only thing that's missing is the custom progress info.

I see AsyncFuncProgressChangedEventArgs class in the source, but it's not used anywhere.

Aug 16, 2012 at 8:46 PM

Due to the summer-time it took me more than I was expecting. Today I finally had some time to look after this feature and implement it.

There was one coflict with the name of the class. I was unable to use AsyncFunc because compiler was unable to know when the final type parameter was used as a input parameter and when it was the type of custom progress reporting. That's why I came up with AsyncFuncWithProgress and AsyncActionWith progress. They use ProgressChangedEventArgs<T> which has Data property. You can store whatever type you want there.

As with all the other classes from AsyncFunc family the main configuration happens in the constructor. You just need to pass the right delegate and it will be wired up.

This time I was smart and I crated T4 variadic template to generate many slightly different classes. This solution allowed me to support up to 14 imput parameters.

This feature was complete in 18757 changeset. I don't plan to make a new release just now.

If you need any problems building this project just let me know.

 

Thanks,

Stan

 

Aug 17, 2012 at 12:33 AM

Well, thanks for answer, but I already implemented AsyncFuncWithProgress and AsyncActionWithProgress myself, because my other work kind of depended on it.

I'm not sure, if I implement your solution - depends on how problematic it would be.

However, I did have a problem with compiling the code - even though I changed configuration of AsyncFunc project to Release_3.5, I couldn't compile it. Visual Studio 2008 just couldn't determine correct value of FRAMEWORK_VERSION_4_0 conditional compilation symbol, so I had to manually override that in Legacy code (Tuple and Func with 5/6 arguments). Also I needed to add reference to System.Core assembly, but I assume that wasn't a bug or oversight, but ability to support .NET 2.0.

Nevertheless thanks! Your AsyncFunc solution saved me a lof of pain with asynchronous code and UI updating (I'm not ready yet to upgrade to 4.0/4.5 with Tasks)!

Mar 11, 2013 at 4:06 PM
Hello,

maybe you could update your library with the ProgressChanged functionality on NUGET and here also.
On the current download there is no AsynFuncWithProgress...

Thank you very much!
Norbert
Mar 12, 2013 at 11:31 PM
Hi Norbert,
Thanks for letting me know about this gap. I'll update the Nuget package by the end of the week.

Stan
Mar 18, 2013 at 10:57 PM
I'm afraid I underestimated the time it takes to set up the dev environment for the project that has not been touched in a while.
I made some progress but with some extra, changes I wanted to do some time ago it will take me 2 days before new version is published on NuGet.
Mar 19, 2013 at 9:27 AM
Hey,

doesn't matter - take your time ;-)
Thank you for your lib at all!

Best wishes
norbert

Von: StanislawSwierc [notifications@codeplex.com]
Gesendet: Montag, 18. März 2013 22:57
Bis: Haberl Norbert
Betreff: Re: Extending ReportProgressEvent with custom object [asyncfunc:361142]

From: StanislawSwierc

I'm afraid I underestimated the time it takes to set up the dev environment for the project that has not been touched in a while.
I made some progress but with some extra, changes I wanted to do some time ago it will take me 2 days before new version is published on NuGet.


FH JOANNEUM Gesellschaft mbH
Rechtsform/Legal form: GmbH
Firmenbuchgericht/Court of registry: Landesgericht für ZRS Graz
Firmenbuchnummer/Company registration: FN 125888 f
DVR: 0813559
UID-Nr.: ATU 42361001

Mar 19, 2013 at 5:18 PM
Edited Mar 19, 2013 at 5:20 PM
Done. AsyncFunc v0.3 is now on NuGet!
https://nuget.org/packages/AsyncFunc/
Jul 28, 2013 at 5:37 PM
I had to maintain some code with AsyncFunc, which I've upgraded to use .NET 4.0, so I've downloaded AsyncFunc from NuGet.

However, there are a few bugs there:
  • no zero parameter variants of AsyncFuncWithProgress nor AsyncActionWithProgress
  • generic delegate ProgressChangedEventHandler does not have generic class ProgressChangedEventArgs<T> as parameter
Aug 22, 2013 at 7:20 AM
Edited Sep 8, 2013 at 10:28 PM
Hi mnn,
Thanks for reporting those issues. I've been traveling a bit this summer but now I'm back to the normal mode so I will have some time for the OSS. I've created issues on Codeplex that I will be tracking the work against. Once they are done (this week) I will update the NuGet package and announce it here.

No zero parameter variants of AsyncFuncWithProgress nor AsyncActionWithProgress
https://asyncfunc.codeplex.com/workitem/1848

Generic delegate ProgressChangedEventHandler does not have generic class ProgressChangedEventArgs<T> as parameter
https://asyncfunc.codeplex.com/workitem/1849

Thanks,
Stan
Sep 8, 2013 at 10:44 PM
Today I found enough time to add the missing functionality with the right quality.
Just as before I published it both on Codeplex and Nuget.
Have fun!
Stan