private void SetMessageDetails(AppMessage message) { Title.SetText(message.Title); MessageTB.SetText(message.Quote); AuthorsTB.SetText(string.IsNullOrEmpty(message.Author) ? NO_AUTHORS : message.Author); SourcesTB.SetText(string.IsNullOrEmpty(message.Source) ? NO_SOURCES : message.Source); Date_Created.SetText(TimeAndDateUtility.ConvertDate_String(message.CreatedDate.Date, true)); Time_Created.SetText(TimeAndDateUtility.ConvertTime_String(message.CreatedDate.Time)); bool fullLastDisplayedDate = message.LastDisplayedDate == null || message.LastDisplayedDate.Date == null || message.LastDisplayedDate.Time == null; Last_Displayed_Date.SetText(fullLastDisplayedDate ? DASH : TimeAndDateUtility.ConvertDate_String(message.LastDisplayedDate.Date, true)); Last_Displayed_Time.SetText(fullLastDisplayedDate ? DASH : TimeAndDateUtility.ConvertTime_String(message.LastDisplayedDate.Time)); Status.SetText(message.Show ? ENABLE : DISABLE); Status.SetBackColor(message.Show ? Color.DarkGreen : Color.DarkRed); Status.SetForeColor(Color.WhiteSmoke); string preview = $"\"{MessageTB.Text}\"\r\n\r\n - {AuthorsTB.Text}\r\n\r\nSources:\r\n {SourcesTB.Text}"; PreviewTB.SetText(preview); }
private void ClearMessageDetails() { Title.SetText(DASH); Date_Created.SetText(DASH); Time_Created.SetText(DASH); Last_Displayed_Date.SetText(DASH); Last_Displayed_Time.SetText(DASH); Status.SetText(DASH); Status.SetBackColor(Color.DarkGray); Status.SetForeColor(Color.Black); MessageTB.SetText(NO_MESSAGE); PreviewTB.SetText(NO_MESSAGE); AuthorsTB.SetText(NO_AUTHORS); SourcesTB.SetText(NO_SOURCES); }