private void button6_Click(object sender, EventArgs e) { try { Info(sp10000.GetData(10000)); i++; } catch (Exception ex) { Info(string.Format("There is an issue with Service10000: '" + ex.Message + "'")); } }
// Asynchronous callbacks for displaying results. /*static void AddCallback(object sender, AddCompletedEventArgs e) * { * Info(e.Result); * }*/ private async void Test(int alp) { var task = Task.Factory.StartNew(() => sp10000.GetData(alp)); string str = ""; try { str = await task; } catch (Exception e) { Info("Wystąpił wyjątek: " + e.Message); } Info(str); }