Пример #1
0
        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);
        }
Пример #2
0
 public void Cleanup()
 {
     _controls.Remove(_parentId, SearchTB.GetId());
     _controls.Remove(_parentId, MessageTB.GetId());
     _controls.Remove(_parentId, PreviewTB.GetId());
     _controls.Remove(_parentId, AuthorsTB.GetId());
     _controls.Remove(_parentId, SourcesTB.GetId());
     _controls.Remove(_parentId, MessagesLB.GetId());
     _controls.Remove(_parentId, Title.GetId());
     _controls.Remove(_parentId, Status.GetId());
     _controls.Remove(_parentId, Date_Created.GetId());
     _controls.Remove(_parentId, Time_Created.GetId());
     _controls.Remove(_parentId, Last_Displayed_Date.GetId());
     _controls.Remove(_parentId, Last_Displayed_Time.GetId());
 }
Пример #3
0
        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);
        }