We're working on a Windows App that periodically has to launch operations which may take some time. We've gotten into a pattern of having these operations run on a BackgroundWorker, and writing up a quick WinForm for each operation, where you pass in to the form the necessary parameters, the form wires up the BackgroundWorker and makes the function call, and the form displays the output (progress bar moves, text fills up with updates, etc).
Now obviously, this form is very cookie-cutter. The only part that really differs between form copies is which method is called on which object. So what we'd love to do is make it generic, whereby we can take the form, pass in an object (or null for static calls?), a function name, and an array of parameters, and have it just "go" from there. We've been able to do this with Reflection. The thing we don't like about reflection in this case is the lack of strong-typing; things like mis-spelling the method call are caught at runtime, and not compile time. Is there anything available now that might make this more elegant and robust? I've heard of people talking about things like Delegates and Expression Trees; but I'm not sure the former applies and still a little in the dark about the latter.