示例#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);
 }