Inheritance: SIL.FieldWorks.Common.Controls.ProgressDialogImpl
Exemple #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        /// ------------------------------------------------------------------------------------
        protected virtual void Dispose(bool disposing)
        {
            Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
            if (disposing)
            {
                if (m_progressDialog != null)
                {
                    m_progressDialog.Canceling   -= m_progressDialog_Canceling;
                    m_progressDialog.FormClosing -= m_progressDialog_FormClosing;
                    RemoveStartListener();
                    if (m_fCreatedProgressDlg)
                    {
                        m_progressDialog.DisposeOnGuiThread();
                    }
                }
                if (m_worker != null)
                {
                    m_worker.CancelAsync();
                    m_worker.Dispose();
                }
            }

            m_progressDialog = null;
            m_Exception      = null;
            m_worker         = null;

            m_fDisposed = true;
        }
Exemple #2
0
        private void InitOnOwnerThread()
        {
            if (m_synchronizeInvoke != null && m_synchronizeInvoke.InvokeRequired)
            {
                m_synchronizeInvoke.Invoke(InitOnOwnerThread);
                return;
            }

            m_worker = new BackgroundWorker {
                WorkerSupportsCancellation = true
            };

            m_progressDialog = new ProgressDialogWithTaskDlgImpl(m_owner);

            // This is the only way to force handle creation for a form that is not yet visible.
            IntPtr handle = m_progressDialog.Handle;
        }
		private void InitOnOwnerThread()
		{
			if (m_synchronizeInvoke != null && m_synchronizeInvoke.InvokeRequired)
			{
				m_synchronizeInvoke.Invoke(InitOnOwnerThread);
				return;
			}

			m_worker = new BackgroundWorker { WorkerSupportsCancellation = true };

			m_progressDialog = new ProgressDialogWithTaskDlgImpl(m_owner);

			// This is the only way to force handle creation for a form that is not yet visible.
			IntPtr handle = m_progressDialog.Handle;
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="disposing"></param>
		/// ------------------------------------------------------------------------------------
		protected virtual void Dispose(bool disposing)
		{
			Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			if (disposing)
			{
				if (m_progressDialog != null)
				{
					m_progressDialog.Canceling -= m_progressDialog_Canceling;
					m_progressDialog.FormClosing -= m_progressDialog_FormClosing;
					RemoveStartListener();
					if (m_fCreatedProgressDlg)
						m_progressDialog.DisposeOnGuiThread();
				}
				if (m_worker != null)
				{
					m_worker.CancelAsync();
					m_worker.Dispose();
				}
			}

			m_progressDialog = null;
			m_Exception = null;
			m_worker = null;

			m_fDisposed = true;
		}