I have created a webservice and a method as follows:
[WebMethod]
public bool GetMasterExit(int RoomID)
{
if(GameList[RoomID][0] == "\0")
return true;
else
return false;
}
And then I call this from WP client using the following way but there is a problem that I want the main process blocked until the webservice returns the value I want but in this way the value is wrong for delay.
I have tried to use the Await but I got an error that "cannot await void", so Anyone knows how to solve this problem?
public void Test()
{
ServiceSoapClient GameClient = new ServiceSoapClient();
GameClient.GetMasterExitCompleted += _clientGetMasterExitCompleted;
GameClient.GetMasterExitAsync(RoomID);
Console.WriteLine(MasterExit);
}
public void _clientGetMasterExitCompleted(object sender, GetMasterExitCompletedEventArgs e)
{
MasterExit = e.Result;
}