Esempio n. 1
0
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            if (e.Index >= 0)
            {
                e.DrawBackground();

                MFCommon.Message m = (MFCommon.Message)Items[e.Index];

                var textLocation = e.Bounds;
                textLocation.X      += 20;
                textLocation.Width  -= 20;
                textLocation.Y      += 5;
                textLocation.Height -= 5;

                TextFormatFlags flags = TextFormatFlags.Left
                                        | TextFormatFlags.WordEllipsis;

                Font boldFont = new Font(e.Font, FontStyle.Bold);

                TextRenderer.DrawText(e.Graphics, m.Date + "   " + m.Author,
                                      boldFont, textLocation, e.ForeColor, flags);

                textLocation.Y += 5 + boldFont.Height;
                TextRenderer.DrawText(e.Graphics, m.Text, e.Font, textLocation,
                                      e.ForeColor, flags);
                e.DrawFocusRectangle();
            }
        }
Esempio n. 2
0
 public void AddMessage(String tag, MFCommon.Message message)
 {
     if (!_tabTags.ContainsKey(tag))
     {
         return;
     }
     this.Invoke((MethodInvoker)(() => _tabTags[tag].Items.Add(message)));
 }
Esempio n. 3
0
        public void ShowMessage(MFCommon.Message message)
        {
            authorLabel.Text      = "Comment from: " + message.Author;
            messageDateLabel.Text = message.Date;
            messageBox.Text       = message.Text;

            this.ShowDialog();
        }