Opc.Ua.Server.SubscriptionManager.RaiseSubscriptionEvent C# (CSharp) Method

RaiseSubscriptionEvent() protected method

Raises an event related to a subscription.
protected RaiseSubscriptionEvent ( Subscription subscription, bool deleted ) : void
subscription Subscription
deleted bool
return void
        protected virtual void RaiseSubscriptionEvent(Subscription subscription, bool deleted)
        { 
            SubscriptionEventHandler handler = null;

            lock (m_eventLock)
            {
                handler = m_SubscriptionCreated;

                if (deleted)
                {
                    handler = m_SubscriptionDeleted;
                }
            } 

            if (handler != null)
            {
                try
                {
                    handler(subscription, deleted);
                }
                catch (Exception e)
                {
                    Utils.Trace(e, "Subscription event handler raised an exception.");
                }
            }
        }
        #endregion