示例#1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">set to <c>true</c> if called from the Dispose() method,
        /// set to <c>false</c> if called by GC. If this parameter is <c>false</c> we shouldn't
        /// access any managed objects since these might already have been destroyed.</param>
        /// ------------------------------------------------------------------------------------
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (m_textBoxControl != null)
                {
                    m_textBoxControl.Dispose();
                }
                if (m_collatingEngine != null)
                {
                    m_collatingEngine.Close();
                }
                if (m_fontCache != null && m_fontCache.Count > 0)
                {
                    foreach (Font fnt in m_fontCache.Values)
                    {
                        fnt.Dispose();
                    }

                    m_fontCache.Clear();
                }
            }

            m_textBoxControl  = null;
            m_cache           = null;
            m_collatingEngine = null;
            m_fontCache       = null;
            base.Dispose(disposing);
        }
示例#2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        /// ------------------------------------------------------------------------------------
        protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (m_collatingEngine != null && m_fCollatingEngineIsOpen)
                {
                    m_collatingEngine.Close();
                }

                if (m_IcuCleanupManager != null)
                {
                    m_IcuCleanupManager.UnregisterCleanupCallback(this);
                }
            }

            m_collatingEngine   = null;
            m_IcuCleanupManager = null;

            m_fDisposed = true;
        }