0
var lockClient = new ServiceReference1.LockSoapClient();
lockClient.AcquireLockAsync();

bool status=true;
lockClient.AcquireLockCompleted += (s, e1) =>
{
     status = e1.Result;
};

sendStat(status);

我想直接在 sendStat() 方法中传递boolean true/false我得到的那个。e.Result例如sendStat(e1.Result),我不想在该lockClient.AcquireLockCompleted部分中调用此方法。我该怎么做?

真实的例子

Brush brush = GetPolygonFill(vectorPolygon, false, Settings.LightSourcePosition, adjust);

这个

Settings.LightSourcePosition

部分需要来自网络服务

4

1 回答 1

1

There's no way to that outside of the completed method because of the async call. Anything inside the completed method is guaranteed to be executed once you have the results from your async call.

于 2013-04-03T21:18:31.220 回答