Пример #1
0
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposeEvenManagedStuff">true to dispose managed and unmanaged resources; false to dispose unmanaged resources</param>
        protected void Dispose(bool disposeEvenManagedStuff)
        {
            // prevent double disposing
            if (Interlocked.Exchange(ref m_disposed, 1) != 0)
            {
                return;
            }

            if (disposeEvenManagedStuff)
            {
                if (m_scans != null)
                {
                    m_scans.CanAcceptNextCustomScan   -= new EventHandler(Scans_CanAcceptNextCustomScan);
                    m_scans.PossibleParametersChanged -= new EventHandler(Scans_PossibleParametersChanged);
                    m_scans.Dispose();
                    m_scans = null;
                }
            }
        }