Exemplo n.º 1
0
 /// <summary>
 /// Closes a connection point callback with the COM server.
 /// </summary>
 private void Unadvise()
 {
     if (m_connection != null)
     {
         if (m_connection.Unadvise() == 0)
         {
             m_connection.Dispose();
             m_connection = null;
         }
     }
 }
Exemplo n.º 2
0
        protected virtual void Dispose(bool disposing)
        {
            if (m_disposed)
            {
                return;
            }

            lock (this)
            {
                if (disposing && m_connection != null)
                {
                    m_connection.Dispose();
                    m_connection = null;
                }

                if (m_subscription != null)
                {
                    OpcCom.Interop.ReleaseServer(m_subscription);
                    m_subscription = null;
                }
            }

            m_disposed = true;
        }