Folks, thanks for the feedback. I made a poor original decision to keep the
proxy alive for app duration. I think I thought it was a heavyweight object
and should be kept alive, which I now doubt is the case.

 

Having a single proxy caused my async event handling to be cumbersome, as
the skeleton code showed. It's much better to use this pattern (a stripped
down sample from my code):

 

public void LoadReport(int context, string name, bool compressed,
Action<bool, Exception, ReportResultWrapper> callback)

{

    using (var client = MakeClient())

    {

        client.Proxy.LoadReportCompleted += (s, e) =>

        {

            callback(e.Cancelled, e.Error, e.Result);

        };

        client.Proxy.LoadReportAsync(context, name, compressed);

    }

}

 

Greg

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to