private void ReplayToAll_Click(object sender, RoutedEventArgs e) { if (currentUserPtr != null && this.listView.SelectedIndex != -1) { if (currentFolderPointer == currentUserPtr.inbox || currentFolderPointer == currentUserPtr.spam || currentFolderPointer == currentUserPtr.deleted) { SendMessageWindow sendMessageWindow = new SendMessageWindow(this); int selectedMail = this.listView.SelectedIndex; sendMessageWindow.recipient.Text = currentFolderPointer[selectedMail].Receiver; sendMessageWindow.copyRecipient.Text = currentFolderPointer[selectedMail].CopyReceiver; if (sendMessageWindow.ShowDialog() == true) { // text = dw.textbox.Text; } } else if (currentFolderPointer == currentUserPtr.sent) { MessageBox.Show("You cannot replay for your own email", "Error"); } else { MessageBox.Show("Choose email to replay", "Error"); } } else { MessageBox.Show("Choose email to replay", "Error"); } }
private void Item_MouseDoubleClick(object sender, MouseButtonEventArgs e) { SendMessageWindow sendMessageWindow = new SendMessageWindow(this); int selectedMail = this.listView.SelectedIndex; sendMessageWindow.subject.Text = currentFolderPointer[selectedMail].Topic; sendMessageWindow.author.Text = currentFolderPointer[selectedMail].Author; sendMessageWindow.recipient.Text = currentFolderPointer[selectedMail].Receiver; DecodeRFT(sendMessageWindow, selectedMail); //sendMessageWindow.content.Content.AppendText(currentFolderPointer[selectedMail].ContentRTF); for (int i = 0; i < currentFolderPointer[selectedMail].attachments.Count; i++) { sendMessageWindow.addedAtachements.Items.Add(currentFolderPointer[selectedMail].attachments[i]); } //sendMessageWindow.author.IsEnabled = false; //sendMessageWindow.recipient.IsReadOnly = true; sendMessageWindow.recipient.IsEnabled = false; sendMessageWindow.content.Content.IsReadOnly = true; sendMessageWindow.copyRecipient.Text = ""; sendMessageWindow.addAtachement.IsEnabled = false; sendMessageWindow.sendButton.IsEnabled = false; if (sendMessageWindow.ShowDialog() == true) { // text = dw.textbox.Text; } }
public void SendMessageWindow_MouseDoubleClick(object sender, RoutedEventArgs e) { SendMessageWindow sendMessageWindow = new SendMessageWindow(this); if (sendMessageWindow.ShowDialog() == true) { // text = dw.textbox.Text; } }
private void DecodeRFT(SendMessageWindow sendMessageWindow, int selectedMail) { string rtfText = currentFolderPointer[selectedMail].ContentRTF; byte[] byteArray = Encoding.ASCII.GetBytes(rtfText); using (MemoryStream ms = new MemoryStream(byteArray)) { TextRange tr = new TextRange(sendMessageWindow.content.Content.Document.ContentStart, sendMessageWindow.content.Content.Document.ContentEnd); tr.Load(ms, DataFormats.Rtf); } }
private void forwardButton_Click(object sender, RoutedEventArgs e) { if (this.listView.SelectedIndex != -1) { SendMessageWindow sendMessageWindow = new SendMessageWindow(this); int selectedMail = this.listView.SelectedIndex; sendMessageWindow.subject.Text = currentFolderPointer[selectedMail].Topic; sendMessageWindow.content.Content.AppendText(currentFolderPointer[selectedMail].Content); if (sendMessageWindow.ShowDialog() == true) { // text = dw.textbox.Text; } } else { MessageBox.Show("Choose email to forward", "Error"); } }