Ejemplo n.º 1
0
        private void ExecuteOperation(ThreadTerminator currentTerminator)
        {
            lock(sync)
            {
                MoneyConverterClient wcfClient = new MoneyConverterClient();

                try
                {
                    wcfClient.Open();
                    method.Invoke(wcfClient);
                    wcfClient.Close();

                    currentTerminator.ThrowIfCancellationRequested();
                }
                catch (TimeoutException timeout)
                {
                    JobState.Invoke(jobTimeout);
                    wcfClient.Abort();
                }
                catch (CommunicationException commException)
                {
                    JobState.Invoke(jobCommunicationException);
                    wcfClient.Abort();
                }
            }
        }
Ejemplo n.º 2
0
        private void ExecuteOperation(ThreadTerminator currentTerminator)
        {
            lock (sync)
            {
                MoneyConverterClient wcfClient = new MoneyConverterClient();

                try
                {
                    wcfClient.Open();
                    method.Invoke(wcfClient);
                    wcfClient.Close();

                    currentTerminator.ThrowIfCancellationRequested();
                }
                catch (TimeoutException timeout)
                {
                    JobState.Invoke(jobTimeout);
                    wcfClient.Abort();
                }
                catch (CommunicationException commException)
                {
                    JobState.Invoke(jobCommunicationException);
                    wcfClient.Abort();
                }
            }
        }
Ejemplo n.º 3
0
        private void client_ConvertCurrency(MoneyConverterClient currentConverter, object o)
        {
            DataModelForConverter data = (DataModelForConverter)o;
            double result = currentConverter.Convert(data.SourceCurrency,
                                                     data.DestinationCurrency,
                                                     data.Amount,
                                                     data.Date);

            this.resultTextBox.BeginInvoke(new Action <double>(DrawResult), result);
        }
Ejemplo n.º 4
0
        private void client_ConvertCurrency(MoneyConverterClient currentConverter, object o)
        {
            DataModelForConverter data = (DataModelForConverter) o;
            double result = currentConverter.Convert(data.SourceCurrency,
                                              data.DestinationCurrency,
                                              data.Amount,
                                              data.Date);

            this.resultTextBox.BeginInvoke(new Action<double>(DrawResult), result);
        }
Ejemplo n.º 5
0
        public void ExecuteOperation()
        {
            MoneyConverterClient wcfClient = new MoneyConverterClient();

            try
            {
                ConverterMethod.Invoke(wcfClient);
                wcfClient.Close();
            }
            catch (TimeoutException timeout)
            {
                // Handle the timeout exception.
                wcfClient.Abort();
            }
            catch (CommunicationException commException)
            {
                // Handle the communication exception.
                wcfClient.Abort();
            }
        }
Ejemplo n.º 6
0
        public void ExecuteOperation()
        {
            MoneyConverterClient wcfClient = new MoneyConverterClient();

            try
            {
                ConverterMethod.Invoke(wcfClient);
                wcfClient.Close();
            }
            catch (TimeoutException timeout)
            {
                // Handle the timeout exception.
                wcfClient.Abort();
            }
            catch (CommunicationException commException)
            {
                // Handle the communication exception.
                wcfClient.Abort();
            }

        }
Ejemplo n.º 7
0
 private void client_DoList(MoneyConverterClient obj, object o)
 {
     this.currencyListComboBox.BeginInvoke(new Action <List <string> >(SetComboBoxData),
                                           obj.GetCurrentcyList());
 }
Ejemplo n.º 8
0
 private void client_DoList(MoneyConverterClient obj, object o)
 {
     this.currencyListComboBox.BeginInvoke(new Action<List<string> >(SetComboBoxData), 
                                           obj.GetCurrentcyList());
 }