private async Task ShowErrorAndClose(string caption, RdpException e)
        {
            using (TraceSources.IapDesktop.TraceMethod().WithParameters(e.Message))
            {
                await this.eventService.FireAsync(
                    new ConnectionFailedEvent(this.Instance, e))
                .ConfigureAwait(true);

                this.exceptionDialog.Show(this, caption, e);
                Close();
            }
        }
        private async Task ShowErrorAndClose(string caption, RdpException e)
        {
            using (ApplicationTraceSources.Default.TraceMethod().WithParameters(e.Message))
            {
                // Make sure we're not fullscreen anymore.
                LeaveFullScreen();

                await this.eventService.FireAsync(
                    new ConnectionFailedEvent(this.Instance, e))
                .ConfigureAwait(true);

                this.exceptionDialog.Show(this, caption, e);
                Close();
            }
        }