private void OnEnterButtonClick(object sender, RoutedEventArgs e) { if (AllowEnter()) { User user = new User(EmailBox.Text, PasswordBox.Password.ToString()); SendMailWindow sm = new SendMailWindow(user, (MailService)MailServiceListBox.SelectedItem); sm.Show(); this.Close(); } }
private void WriteMenuItem_Click(object sender, RoutedEventArgs e) { if (inboxThread != null && inboxThread.IsAlive) { inboxThread.Abort(); inboxThread.Join(); } if (this.CurrentUser.EmailBoxes[this.CurrentUser.SelectedEmailBoxIndex].Smtp == null || !this.CurrentUser.EmailBoxes[this.CurrentUser.SelectedEmailBoxIndex].Smtp.Connected) { this.CurrentUser.EmailBoxes[this.CurrentUser.SelectedEmailBoxIndex].ConnectSmtp(); } SendMailWindow sendMailWindow = new SendMailWindow( this.CurrentUser.EmailBoxes[this.CurrentUser.SelectedEmailBoxIndex]) { Owner = this }; sendMailWindow.ShowDialog(); this.DownloadMessagesToClient(this.messagesType); }