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 30 31 32 33 34 35
| void client_GetFondsEcranPDACompleted(object sender, SilverlightApplication2.ServiceWCF.GetFondsEcranPDACompletedEventArgs e)
{
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetFondsEcranPDACompleted -= new EventHandler<SilverlightApplication2.ServiceWCF.GetFondsEcranPDACompletedEventArgs>(client_GetFondsEcranPDACompleted);
String[] FondsEcran;
FondsEcran = e.Result.ToArray();
client.GetIdImageFondEcranCompleted += new EventHandler<SilverlightApplication2.ServiceWCF.GetIdImageFondEcranCompletedEventArgs>(client_GetIdImageFondEcranCompleted);
for (int i = 0; i < FondsEcran.Length; i++)
{
String NomFondsEcran = FondsEcran[i];
FondEcran FdE = new FondEcran() { Nom = NomFondsEcran };
client.GetIdImageFondEcranAsync(NomFondsEcran, FdE);
}
}
void client_GetIdImageFondEcranCompleted(object sender, SilverlightApplication2.ServiceWCF.GetIdImageFondEcranCompletedEventArgs e)
{
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetIdImageFondEcranCompleted -= new EventHandler<SilverlightApplication2.ServiceWCF.GetIdImageFondEcranCompletedEventArgs>(client_GetIdImageFondEcranCompleted);
FondEcran FdE = e.UserState as FondEcran;
Decimal Id = e.Result;
FdE.Id = Id;
client.GetImageCompleted += new EventHandler<SilverlightApplication2.ServiceWCF.GetImageCompletedEventArgs>(client_GetImageCompleted);
client.GetImageAsync(Id, FdE);
}
void client_GetImageCompleted(object sender, SilverlightApplication2.ServiceWCF.GetImageCompletedEventArgs e)
{
ServiceWCF.ServiceWCFClient client = new SilverlightApplication2.ServiceWCF.ServiceWCFClient();
client.GetImageCompleted -= new EventHandler<SilverlightApplication2.ServiceWCF.GetImageCompletedEventArgs>(client_GetImageCompleted);
FondEcran FdE = e.UserState as FondEcran;
FdE.Image = e.Result;
ListBoxFondsEcran.Items.Add(FdE);
} |
Partager