Skip to content

Commit

Permalink
Add time to date in list of emails
Browse files Browse the repository at this point in the history
Move subject above attachments in print headers
(Originally by flywire in pull request #19)
Dijji committed Dec 7, 2019
1 parent 1090d3f commit fddc899
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -489,7 +489,7 @@ private bool PropertyHitTest(int index, string text, bool subject, bool fromTo,
Message m = listMessages.Items[index] as Message;
if ((subject && m.Subject != null && m.Subject.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) >= 0) ||
(fromTo && m.FromTo != null && m.FromTo.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) >= 0) ||
(date && m.DisplayDate != null && m.DisplayDate.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) >= 0))
(date && m.DisplayDate.IndexOf(text, StringComparison.CurrentCultureIgnoreCase) >= 0))
{
searchIndex = index;
listMessages.UnselectAll();
6 changes: 3 additions & 3 deletions Message.cs
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ class Message : INotifyPropertyChanged
public DateTime? Submitted { get; set; }
public DateTime? Modified { get; set; } // When any attachment was last modified
public DateTime? Date { get { return Received ?? Submitted; } }
public string DisplayDate { get { return Date != null ? ((DateTime)Date).ToShortDateString() : "<unknown>"; } }
public string DisplayDate { get { return Date != null ? ((DateTime)Date).ToString("g") : "<unknown>"; } }
public NID Nid { get; set; }
public BodyType NativeBody { get; set; }
public string Body { get; set; }
@@ -262,9 +262,9 @@ public string EmbedHtmlPrintHeader(string body, bool showEmailType = false)
header.AppendFormat(row, "Cc:", CcDisplayList);
if (HasBccDisplayList)
header.AppendFormat(row, "Bcc:", BccDisplayList);
header.AppendFormat(row, "Subject:", Subject);
if (HasFileAttachment)
header.AppendFormat(row, "Attachments:", FileAttachmentDisplayList);
header.AppendFormat(row, "Subject:", Subject);
header.Append("</tbody></table><p/><p/>");

return body.Insert(insertAt, header.ToString());
@@ -312,9 +312,9 @@ public void EmbedRtfPrintHeader(FlowDocument doc, bool showEmailType = false)
AddRtfTableRow(table1, "Cc:", CcDisplayList);
if (HasBccDisplayList)
AddRtfTableRow(table1, "Bcc:", BccDisplayList);
AddRtfTableRow(table1, "Subject:", Subject);
if (HasFileAttachment)
AddRtfTableRow(table1, "Attachments:", FileAttachmentDisplayList);
AddRtfTableRow(table1, "Subject:", Subject);

// Cope with the empty document case
if (doc.Blocks.Count == 0)

0 comments on commit fddc899

Please sign in to comment.