예제 #1
0
 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));
     }
 }
예제 #2
0
        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);
        }