예제 #1
0
        private void datagridOnSelected(object sender, RoutedEventArgs e)
        {
            if (!imapClient.IsAuthenticated)
            {
                login();
            }
            readMail rM = new readMail();

            MessageBox.Show("ww" + dataGrid.SelectedItem.ToString().Split('=')[5].Substring(1, dataGrid.SelectedItem.ToString().Split('=')[5].Length - 3) + "ww");
            string[] x = { dataGrid.SelectedItem.ToString().Split('=')[5].Substring(1, dataGrid.SelectedItem.ToString().Split('=')[5].Length - 3) };
            intializeFolder();
            var temp = fol.GetMessage(UniqueId.Parse(x[0]));

            rM.Title        = temp.Subject;
            rM.lb1.Content += temp.Date.ToString();
            rM.lb2.Content += temp.Subject;
            rM.lb3.Content += temp.From.ToString();
            Uri uri;

            if (temp.HtmlBody != null)
            {
                StreamWriter sw = new StreamWriter("d:\\temp.html", false); sw.Write(temp.HtmlBody); sw.Close();
                uri = new Uri(@"d:\temp.html", UriKind.Absolute);
            }
            else
            {
                uri = new Uri("data:text/plain," + temp.TextBody, UriKind.Absolute);
            }
            rM.wb.Source = uri;
            rM.Show();
        }
예제 #2
0
 private void datagridOnSelected(object sender, RoutedEventArgs e) {
     if (!imapClient.IsAuthenticated)
         login();
     readMail rM = new readMail();
     MessageBox.Show("ww" + dataGrid.SelectedItem.ToString().Split('=')[5].Substring(1, dataGrid.SelectedItem.ToString().Split('=')[5].Length - 3) + "ww");
     string[] x = { dataGrid.SelectedItem.ToString().Split('=')[5].Substring(1, dataGrid.SelectedItem.ToString().Split('=')[5].Length - 3) };
     intializeFolder();
     var temp = fol.GetMessage(UniqueId.Parse(x[0]));
     rM.Title = temp.Subject;
     rM.lb1.Content += temp.Date.ToString();
     rM.lb2.Content += temp.Subject;
     rM.lb3.Content += temp.From.ToString();
     Uri uri;
     if (temp.HtmlBody != null) {
         StreamWriter sw = new StreamWriter("d:\\temp.html", false); sw.Write(temp.HtmlBody); sw.Close();
         uri = new Uri(@"d:\temp.html", UriKind.Absolute);
     }
     else
         uri = new Uri("data:text/plain," + temp.TextBody, UriKind.Absolute);
     rM.wb.Source = uri;
     rM.Show();
 }