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