private void ButtonRemoteException_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UIPublic.ShowWaitingForm(); try { var testService = new TcpRemoteFactory <ITestService>() { ServerAddress = "localhost:7990", ServiceName = "TestService" }.Value; testService.GetString("Exception"); } catch (Exception err) { UIPublic.CloseWaitingForm(); UIPublic.ShowEventDialog(new ExceptionEventInfo(err, true, true)); } }
private void ButtonCallRemote_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { UIPublic.ShowWaitingForm(); string resultString = ""; var task = Task.Factory.StartNew(() => { var testService = new TcpRemoteFactory <ITestService>() { ServerAddress = "localhost:7990", ServiceName = "TestService" }.Value; resultString = testService.GetString("Hello world!"); }); task.Wait(); UIPublic.CloseWaitingForm(); UIPublic.ShowInfomationDialog(resultString); }