Пример #1
0
 public void EnqueuePopupThreadSafe(PopupViewModel popup)
 {
     lock (_lockerOfPopups)
     {
         _popups.Enqueue(popup);
     }
 }
Пример #2
0
        private void OnTimerClick(object state, ElapsedEventArgs elapsedEventArgs)
        {
            if (!_canPopup.Invoke(null))
            {
                return;
            }
            PopupViewModel newPopup = null;

            lock (_lockerOfPopups)
            {
                var newPopupExists = _popups.Count > 0;
                if (newPopupExists)
                {
                    newPopup = _popups.Dequeue();
                }
            }

            if (newPopup == null)
            {
                return;
            }
            OnNewPopupDequeued(newPopup);
        }
Пример #3
0
 protected virtual void OnNewPopupDequeued(PopupViewModel obj)
 {
     NewPopupDequeued?.Invoke(obj);
 }