private async Task <ProxySettings> GetProxySettingsAsync()
        {
            using (var communicator = _communicatorFactory.Create())
            {
                var communicationResult = await communicator.GetProxySettingsAsync();

                return(communicationResult.IsCompleted
                           ? communicationResult.Response.Map <ProxySettings>()
                           : null);
            }
        }
Ejemplo n.º 2
0
        public async Task HandleAsync(DomainCommandContext context, LoadProxySettingsCommand command)
        {
            using (var communicator = _communicatorFactory.Create())
            {
                var result = await communicator.GetProxySettingsAsync();

                if (result.IsCompleted)
                {
                    await context.PublishAsync(new ProxySettingsLoadedEvent(result.Response.Map <ProxySettings>()));

                    return;
                }

                await context.EmitAsync(new ErrorOccuredNotification());
            }
        }