Beispiel #1
0
        private void SelectedMailChanged(object sender, SelectionChangedEventArgs e)
        {
            EmlFile item = null;
            var     list = (ListView)sender;

            if (list.SelectedItem != null)
            {
                item = (EmlFile)list.SelectedItem;
            }

            if (item != null)
            {
                TextSender.Text  = item.Sender;
                TextSubject.Text = item.FormattedSubject;
                TextCreated.Text = $"{item.Created.ToShortDateString()} {item.Created.ToShortTimeString()}";

                var html = item.GetHtml().Replace("<title>", "<meta http-equiv=\"X-UA-Compatible\" content=\"IE edge\" /><title>");
                webBrowser.NavigateToString(html);
            }
            else
            {
                TextSender.Text  = string.Empty;
                TextSubject.Text = string.Empty;
                TextCreated.Text = string.Empty;
                webBrowser.NavigateToString(string.Empty);
            }
        }
Beispiel #2
0
        public void AddFile(string path)
        {
            var file = new EmlFile(path);

            mailList.Dispatcher.Invoke(new Action(() =>
            {
                files.Add(file);
            }));
        }