private void handleEmailServiceException(Exception e, string accountName = "") { MyMessageBox.displayAndClose("błąd konta " + accountName + "\r\n" + e.Message + " " + e.InnerException + "\r\nsee the errorlog file for details", 5); string errorLogFileName = "emailNotifierError.log"; string errorText = DateTime.Now.ToString() + "\r\n" + e.Message + "\r\n" + e.InnerException + "\r\n" + e.Source + "\r\n" + e.StackTrace + "\r\n" + "\r\n"; saveTextToFile(errorText, errorLogFileName); }
private void SaveToFileButon_Click(object sender, EventArgs e) { string textToPrint = DateTime.Now.ToString() + "\r\n\r\n"; foreach (EmailAccount account in emailAccountDict.Values) { textToPrint += account.ToString(); } saveTextToFile(textToPrint, ProgramSettings.fileSavePath + ProgramSettings.emailTextSummaryFileName); MyMessageBox.displayAndClose("saved", 1); }
// ręczne sprawdzanie poczty private async void checkForEmailsButton_Click(object sender, EventArgs e) { try { if (emailsDisplayed != EmailListType.none) { closeEmailsDisplayWindow(); } if (await checkForEmails()) { saveDataToFile(); displayNewEmails(); } else { MyMessageBox.displayAndClose("no new messages"); } } catch (ArgumentException exc) { MyMessageBox.display(exc.Message, MyMessageBoxType.Error); } }