Пример #1
0
        private async Task TestConnectivityAsync()
        {
            Testing = new TestingContext {
                Message = Resources.TestingConnectivityStatus
            };

            var available = false;
            await Task.Factory.StartNew(() => { available = NetworkInterface.GetIsNetworkAvailable(); });

            if (!available)
            {
                Testing = new TestingContext {
                    Message   = Resources.TestingConnectivityStatus,
                    IsFaulted = true
                };
            }
        }
Пример #2
0
        private async Task TestImapSettingsAsync()
        {
            Testing = new TestingContext {
                Message = Resources.TestingImapStatus
            };

            try {
                using (var connection = new ImapConnection {
                    Security = ImapSecurity
                }) {
                    using (var auth = await connection.ConnectAsync(ImapHost, ImapPort)) {
                        await auth.LoginAsync(ImapUsername, ImapPassword);
                    }
                }
            } catch (Exception ex) {
                Testing = new TestingContext {
                    IsFaulted = true,
                    Message   = ex.Message
                };
                Logger.Error(ex);
            }
        }