コード例 #1
0
        public void AddNotifiaction(NotifiactionModel notification)
        {
            notification.Id = count++;
            if (NotifiactionList.Count + 1 > MAX_NOTIFICATIONS)
            {
                buffer.Add(notification);
            }
            else
            {
                NotifiactionList.Add(notification);
            }

            //Show window if there're notifications
            if (NotifiactionList.Count > 0 && !IsActive)
            {
                Show();
            }
        }
コード例 #2
0
        public void RemoveNotification(NotifiactionModel notification)
        {
            if (NotifiactionList.Contains(notification))
            {
                NotifiactionList.Remove(notification);
            }

            if (buffer.Count > 0)
            {
                NotifiactionList.Add(buffer[0]);
                buffer.RemoveAt(0);
            }

            //Close window if there's nothing to show
            if (NotifiactionList.Count < 1)
            {
                Hide();
            }
        }