Esempio n. 1
0
        public async Task <IUcResult <bool> > ExecuteAsync(Func <EpasSoapServiceInterfaceClient, Task> execute)
        {
            var result = new UcResult <bool>();
            var client = this.clientFactory.CreateClient(this.server);

            try
            {
                await execute(client);

                client.Close();
                result.Value = true;
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }
Esempio n. 2
0
        public IUcResult <TResultValue> Execute <TResultValue>(Func <EpasSoapServiceInterfaceClient, TResultValue> execute)
        {
            var result = new UcResult <TResultValue>();
            var client = this.clientFactory.CreateClient(this.server);

            try
            {
                result.Value = execute(client);
                client.Close();
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }
Esempio n. 3
0
        public async Task <IUcResult <bool> > ExecuteAsync(Func <PerfmonPortTypeClient, Task> execute)
        {
            var result = new UcResult <bool>();
            var client = this.clientFactory.CreateClient(this.clientSettings);

            try
            {
                await execute(client);

                client.Close();
                result.Value = true;
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }
Esempio n. 4
0
        public IUcResult <TResultValue> Execute <TResultValue>(Func <PerfmonPortTypeClient, TResultValue> execute)
        {
            var result = new UcResult <TResultValue>();
            var client = this.clientFactory.CreateClient(this.clientSettings);

            try
            {
                result.Value = execute(client);
                client.Close();
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }
Esempio n. 5
0
        public async Task <IUcResult <TResultValue> > ExecuteAsync <TResultValue>(Func <AXLPortClient, Task <TResultValue> > execute)
        {
            var result = new UcResult <TResultValue>();
            var client = this.clientFactory.CreateClient(this.clientSettings);

            try
            {
                result.Value = await execute(client);

                client.Close();
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }
Esempio n. 6
0
        public IUcResult <bool> Execute(Action <AXLPortClient> execute)
        {
            var result = new UcResult <bool>();
            var client = this.clientFactory.CreateClient(this.clientSettings);

            try
            {
                execute(client);
                client.Close();
                result.Value = true;
            }
            catch (CommunicationException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (TimeoutException exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            catch (Exception exception)
            {
                result.Exception = exception;
                client.Abort();
            }
            return(result);
        }