Exemple #1
0
 public void Init(WMessage msg, int width)
 {
     label1.Text = msg.Text;
     if (!String.IsNullOrWhiteSpace(msg.Link))
     {
         label1.Font      = new System.Drawing.Font(label1.Font, FontStyle.Underline);
         label1.ForeColor = Color.Blue;
         label1.Tag       = msg.Link;
         label1.Cursor    = Cursors.Hand;
     }
     this.Width = width;
     using (var g = Graphics.FromHwnd(label1.Handle)) {
         var size = g.MeasureString(label1.Text, label1.Font, label1.ClientSize.Width, StringFormat.GenericDefault);
         this.Height = Math.Max((int)(size.Height + label1.Padding.Vertical), bClose.Height + bClose.Margin.Vertical) + 1 + this.Padding.Vertical;
     }
 }
Exemple #2
0
 public static void Message(WMessage m)
 {
     if (MessageReceived != null)
     {
         foreach (var pending in _pendingMessages)
         {
             MessageReceived(null, new MessageEventArgs()
             {
                 Message = pending
             });
         }
         _pendingMessages.Clear();
         MessageReceived(null, new MessageEventArgs()
         {
             Message = m
         });
     }
     else
     {
         _pendingMessages.Add(m);
     }
 }