Geeks With Blogs
Phubar Baz Musings of an HTML5 Programmer September 2012 Entries
Get Func-y v2.0
In my last post I talked about using funcs in C# to do async calls in WinForms to free up the main thread for the UI. In that post I demonstrated calling a method and then waiting until the value came back. Today I want to talk about calling a method and then continuing on and handling the results of the async call in a callback.The difference is that in the previous example although the UI would not lock up the user couldn't really do anything while the other thread was working because it was waiting ......

Posted On Wednesday, September 26, 2012 1:31 PM

Get Func-y
I was working on a Windows form app and needed a way to call out to a service without blocking the UI. There are a lot of ways to do this but I came up with one that I thought was pretty simple. It utilizes the System.Func<> generic class, which is basically a way to create delegates using generics. It's a lot more compact and simpler than creating delegates for each method you want to call asynchronously. I wanted to get it down to one line of code, but it was a lot simpler to use three lines.In ......

Posted On Monday, September 10, 2012 3:49 PM

Copyright © PhubarBaz | Powered by: