1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
# // Le WebService
# batch.Add(
# (b) =>
# {
# TestServiceSoapClient client = new Services.TestServiceSoapClient();
#
# // fin de l'appel
# client.HelloWorldCompleted += (s, ev) =>
# {
# if (ev.Error == null)
# {
# MessageBox.Show(ev.Result);
#
# // on peut utiliser b directement
# //b.IsCompleted = true;
# // autre possibilitées
# BatchAction action = ev.UserState as BatchAction;
# action.IsCompleted = true;
# }
# };
#
# // un userState peut être mis dans b si necessaire
# //b.UserState = monUserState;
# // appel
# client.HelloWorldAsync(b);
# }
# ); |
Partager