Opc.Ua.Com.Server.ComDaGroup.Dispose C# (CSharp) Method

Dispose() protected method

An overrideable version of the Dispose.
protected Dispose ( bool disposing ) : void
disposing bool
return void
        protected virtual void Dispose(bool disposing)
        {
            m_disposed = true;
 
            if (disposing)
            {
                lock (m_lock)
                {
                    if (m_updateTimer != null)
                    {
                        m_updateTimer.Dispose();
                        m_updateTimer = null;
                    }

                    // release the callback.
                    Utils.SilentDispose(m_callback);
                    m_callback = null;

                    // clear all outstanding requests.
                    m_requests.Clear();
                }
            }
        }

Same methods

ComDaGroup::Dispose ( ) : void

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Removes the group.
        /// </summary>
        /// <param name="group">The group.</param>
        public void RemoveGroup(ComDaGroup group)
        {
            TraceState("RemoveGroup", group.Name);

            lock (m_lock)
            {
                for (int ii = 0; ii < m_groups.Count; ii++)
                {
                    if (Object.ReferenceEquals(group, m_groups[ii]))
                    {
                        m_groups.RemoveAt(ii);

                        if (group.Subscription != null && group.Subscription.Session != null)
                        {
                            group.Subscription.Session.RemoveSubscription(group.Subscription);
                        }
                    }
                }

                group.Dispose();
            }
        }