Ejemplo n.º 1
0
 public void OnNotificationReceived(Notification notification)
 {
     notificationQueue.Enqueue(notification);
 }
        private Control GetNotificationContainer(Notification notification)
        {
            string notificationText = "Участник " + notification.GetSenderId() + " е \\b" + notification.GetSatisfaction() + "\\b0  от доставчик \\b " + notification.GetSupplier() + "\\b0 ";

            RichTextBox notificationBox = new ReadOnlyRichTextBox();
            notificationBox.Width = feedbackLayout.Width - 8;
            notificationBox.Rtf = RTFUtil.ToRTF(notificationText);

            Size size = TextRenderer.MeasureText(notificationBox.Text, notificationBox.Font, notificationBox.ClientRectangle.Size, TextFormatFlags.WordBreak);
            notificationBox.Height = size.Height;
            notificationBox.BackColor = colors.NextColor();

            return notificationBox;
        }
        private void ShowNotification(Notification notification)
        {
            Control notificationBox = GetNotificationContainer(notification);
            feedbackLayout.Controls.Add(notificationBox);
            feedbackLayout.Controls.SetChildIndex(notificationBox, 0);

            animator.flash(notificationBox);
        }
Ejemplo n.º 4
0
 public string ToJson(Notification notification)
 {
     return JsonConvert.SerializeObject(notification.AsDictionary());
 }