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();
                }
            }
        }
        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();
                }
            }
        }
Exemple #3
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();
            }
        }
        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();
            }

        }