private void SendMessage() { if (!String.IsNullOrEmpty(txtBody.Text)) { btnSend.Enabled = false; try { lblInform.Text = "Sending"; feedback.subject = txtSubject.Text; feedback.body = txtBody.Text; feedback.SendMessage(); SendCompleted(); } catch { lblInform.Text = "Error"; btnSend.Enabled = true; InformationBox.Show("Error sending feedback", "Error"); } } else { InformationBox.Show("Make sure you have written a description in the body area", "No Body Found"); } }
void wb_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { try { doc.Load(file); if (doc != null) { if (IsNewerVersion()) { description = doc.SelectSingleNode("update/info/description").InnerText; features = doc.SelectSingleNode("update/info/features").InnerText; version = doc.SelectSingleNode("update/version").InnerText; host = doc.SelectSingleNode("update/link").InnerText; this.Show(); } else if (NotesOrganizer.checkUpdate) { NotesOrganizer.checkUpdate = false; InformationBox.Show("Your program is Up-To-Date", "Update"); } } } catch { InformationBox.Show("Error retrieving update data", "Error"); } }
private void LoadNotes() { try { int noteAmount = save.LoadNotes(); //add and fill in the text boxes for (int i = 0; i < noteAmount; i++) { AddNotes(); Panel pane = NotesOrganizer.area[i]; foreach (Control c in pane.Controls) { if (c is TextBox) { c.Text = save.chronologicalNoteContainer[i].Trim(); if (save.chronologicalBoldTextAnnouncer[i]) { c.Font = new Font(Notes.Properties.Settings.Default.UserFont.Name, Notes.Properties.Settings.Default.UserFont.Size, FontStyle.Bold); } } } } } catch { InformationBox.Show("Error loading notes", "Error"); } Remind(); }
public static void Show(string text, string title) { ib = new InformationBox(); ib.lblText.Text = text; ib.lblTitle.Text = title; ib.FixPositions(false); ib.ShowDialog(); }
private void btnExport_Click(object sender, EventArgs e) { if (NotesOrganizer.GetAndFormatSelectedNotes() != null) { office.Export(NotesOrganizer.GetAndFormatSelectedNotes()); } else { InformationBox.Show("Please select at least one note by clicking on the checkbox", "Invalid Text"); } }
public static DialogResult Show(string text, string title, string link) { ib = new InformationBox(); ib.lblText.Text = text; ib.lblTitle.Text = title; ib.FixPositions(true); ib.btnCopy.Visible = true; ib.btnCopy.Enabled = true; ib.link = link; ib.btnCopy.Location = new Point(0, ib.Size.Height - ib.btnCopy.Size.Height); return(ib.ShowDialog()); }
public static DialogResult Show(string text, string title, string link) { ib = new InformationBox(); ib.lblText.Text = text; ib.lblTitle.Text = title; ib.FixPositions(true); ib.btnCopy.Visible = true; ib.btnCopy.Enabled = true; ib.link = link; ib.btnCopy.Location = new Point(0, ib.Size.Height - ib.btnCopy.Size.Height); return ib.ShowDialog(); }
public void Email(string email, string mail) { try { Microsoft.Office.Interop.Outlook.Application oApp = new Microsoft.Office.Interop.Outlook.Application(); Microsoft.Office.Interop.Outlook._MailItem oMailItem = (Microsoft.Office.Interop.Outlook._MailItem)oApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); oMailItem.To = email; oMailItem.Body = mail; oMailItem.Display(true); } catch { InformationBox.Show("Error saving Outlook contact", "Outlook Error"); } }
public void CreateOutlookContact(string fName = "", string lName = "", string email = "", string address = "", string phone = "") { Microsoft.Office.Interop.Outlook.Application outlookObj = new Microsoft.Office.Interop.Outlook.Application(); ContactItem contact = (ContactItem)outlookObj.CreateItem(OlItemType.olContactItem); try { contact.FirstName = fName; contact.LastName = lName; contact.Email1Address = email; contact.HomeAddress = address; contact.HomeTelephoneNumber = phone; contact.Save(); } catch { InformationBox.Show("Error saving Outlook contact", "Outlook Error"); } }
public void SyncWithOutlook() { this.Parent.Enabled = false; string[] info = new string[4]; if (Interpolation.outlookContacts.Count > 0) { foreach (ContactItem c in Interpolation.outlookContacts) { info[0] = ((c.FirstName != null) ? c.FirstName : "") + " " + ((c.LastName != null) ? c.LastName : ""); info[1] = (c.Email1Address != null ? c.Email1Address : ""); info[2] = (c.HomeAddress != null ? c.HomeAddress : ""); info[3] = (c.HomeTelephoneNumber != null ? c.HomeTelephoneNumber : ""); bool exists = false; foreach (DataGridViewRow row in this.Rows) { string name = ((row.Cells[0].Value) == null) ? "" : row.Cells[0].Value.ToString(); string email = ((row.Cells[1].Value) == null) ? "" : row.Cells[1].Value.ToString(); string address = ((row.Cells[2].Value) == null) ? "" : row.Cells[2].Value.ToString(); string phone = ((row.Cells[3].Value) == null) ? "" : row.Cells[3].Value.ToString(); if (info[0] == name && info[1] == email && info[2] == address && info[3] == phone) { exists = true; break; } } if (!exists) { this.Rows.Add(info); } } } else { InformationBox.Show("Either you don't have Outlook installed, or you don't have any contacts", "No Outlook Contacts Found"); } this.Parent.Enabled = true; }
public void Export(string notes) { try { Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application(); object missing = System.Reflection.Missing.Value; object fileName = "normal.dot"; object newTemplate = false; object docType = 0; object isVisible = true; Document aDoc = WordApp.Documents.Add(ref fileName, ref newTemplate, ref docType, ref isVisible); WordApp.Visible = true; aDoc.Activate(); WordApp.Selection.ParagraphFormat.Alignment = Microsoft.Office.Interop.Word.WdParagraphAlignment.wdAlignParagraphCenter; WordApp.Selection.Font.Bold = (int)Microsoft.Office.Interop.Word.WdConstants.wdToggle; WordApp.Selection.TypeText(notes); } catch { InformationBox.Show("Your document will be exported to your default text editor", "Microsoft Word not found"); File.WriteAllText("note_expot.txt", notes); Process.Start("note_expot.txt"); } }
private void btnDetails_Click_1(object sender, EventArgs e) { InformationBox.Show(description + "\r\n" + "\r\nNew Version: " + version + "\r\n" + "\r\nFeatures:" + features, "Update Details"); }
private void btnYes_Click_1(object sender, EventArgs e) { InformationBox.Show("All application processes will be closed\r\n", "Update"); System.Diagnostics.Process.Start(host); NotesProgram.exit = true; }