Пример #1
0
        /// <summary>
        /// Deliver notifications if delivery is allowed.
        /// </summary>
        private static void TriggerNotif()
        {
            while (m_notifLockCount == 0 && m_notifQueue.Count > 0)
            {
                // While we are firing, we need to lock notifications so that
                // we don't end up with two executions of this method.
                m_notifLockCount++;
                KwsSmNotif n   = m_notifQueue.Dequeue();
                Workspace  kws = n.Kws;

                try
                {
                    if (kws.OnKwsSmNotif != null)
                    {
                        kws.OnKwsSmNotif(kws, n);
                    }
                }

                catch (Exception ex)
                {
                    // We cannot handle failures in notifications.
                    KBase.HandleException(ex, true);
                }

                m_notifLockCount--;
            }
        }