well…using Radical AsyncWorker we can write something like:
public void Do()
{
AsyncWorker.Using( this.Id )
.Configure( cfg =>
{
cfg.Before = e =>
{

this.Status = "Running: " + e.Argument;
};

cfg.After = e =>
{
this.Status = "Completed: " + e.Argument;
};
} )
.Execute( e =>
{
//something long running...
Thread.Sleep( 2000 );
} );
}
Cool, interesting, quite easy to read and a really interesting experiment, for me, in writing a complex and intellisense driven fluent interface…
But…
…in a few months everything will drastically change:
public async void Do()
{
this.Status = "Running: " + this.Id;

await Task.Factory.StartNew( () =>
{
//something long running...
Thread.Sleep( 2000 );
} );

this.Status = "Completed: " + this.Id;
}
Amazing Smile
.m