Exemplo n.º 1
0
        private void OnAuthenticationCancelled(object sender, CancellationEventArgs e)
        {
            if (e.Reason == AuthenticationCancelledReason.ConnectionIssue)
            {
                MessageBox.Show(this, "Authentication failed due to network issues.", "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }
            else if (e.Reason != AuthenticationCancelledReason.Manual)
            {
                MessageBox.Show(this, "Authentication failed for unknown reasons, check trace logs.", "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }

            Close();
        }
Exemplo n.º 2
0
        private void OnAuthenticationCancelled(object sender, CancellationEventArgs e)
        {
            if (e.Reason == AuthenticationCancelledReason.ConnectionIssue)
            {
                MessageBox.Show(this, "Authentication failed due to network issues.", "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                var fallbackForm = new ManualApiKeyEntryForm(ViewModel);
                var result       = fallbackForm.ShowDialog(this);

                if (result == DialogResult.OK)
                {
                    Authenticate(null, null);
                }
            }
            else if (e.Reason != AuthenticationCancelledReason.Manual)
            {
                MessageBox.Show(this, "Authentication failed for unknown reasons, check trace logs.", "Authentication failed", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
            }

            Close();
        }