Beispiel #1
0
        private async void TestConnectionAsync(string testUrl)
        {
            _testConnectionCommand.SetCanExecute(false);
            _doAutoDiscoveryCommand.SetCanExecute(false);
            try
            {
                var newUrl = await _optionTasks.TestGoogleConnection(_model, testUrl);

                if (newUrl != testUrl)
                {
                    CalenderUrl = newUrl;
                }
            }
            catch (Exception x)
            {
                s_logger.Error("Exception while testing the connection.", x);
                string message = null;
                for (var ex = x; ex != null; ex = ex.InnerException)
                {
                    message += ex.Message + Environment.NewLine;
                }
                MessageBox.Show(message, OptionTasks.ConnectionTestCaption);
            }
            finally
            {
                _testConnectionCommand.SetCanExecute(true);
                _doAutoDiscoveryCommand.SetCanExecute(true);
            }
        }