Пример #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// <param name="disposing"></param>
        /// ------------------------------------------------------------------------------------
        protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                // TODO: Take this out when we use the multi-threaded progress dialog again
                if (m_owner != null)
                {
                    m_owner.Enabled = true;
                }

                if (m_progressDialog != null)
                {
                    if (m_progressDialog.InvokeRequired)
                    {
                        m_progressDialog.BeginInvoke(new MethodInvoker(m_progressDialog.Dispose));
                    }
                    else
                    {
                        m_progressDialog.Dispose();
                    }
                }
            }

            m_progressDialog = null;
            m_Exception      = null;
            m_owner          = null;

            m_fDisposed = true;
        }
Пример #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ProgressDialogWithTask"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// ------------------------------------------------------------------------------------
 public ProgressDialogWithTask(Form owner)
 {
     // The owner might be the splash screen which runs on a separate thread. In this
     // case we want to just ignore it.
     if (owner != null && !owner.InvokeRequired)
     {
         m_owner = owner;
     }
     m_progressDialog                 = new ProgressDialogImpl(m_owner);
     m_progressDialog.Shown          += new EventHandler(OnProgressDialogShown);
     m_progressDialog.Cancel         += new CancelHandler(OnCancel);
     m_progressDialog.VisibleChanged += new EventHandler(OnProgressDialogVisibleChanged);
 }
Пример #3
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:ProgressDialogWithTask"/> class.
		/// </summary>
		/// <param name="owner">The owner.</param>
		/// ------------------------------------------------------------------------------------
		public ProgressDialogWithTask(Form owner)
		{
			// The owner might be the splash screen which runs on a separate thread. In this
			// case we want to just ignore it.
			if (owner != null && !owner.InvokeRequired)
				m_owner = owner;
			m_progressDialog = new ProgressDialogImpl(m_owner);
			m_progressDialog.Shown += new EventHandler(OnProgressDialogShown);
			m_progressDialog.Cancel += new CancelHandler(OnCancel);
			m_progressDialog.VisibleChanged += new EventHandler(OnProgressDialogVisibleChanged);
		}
Пример #4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="disposing"></param>
		/// ------------------------------------------------------------------------------------
		protected void Dispose(bool disposing)
		{
			if (disposing)
			{
				// TODO: Take this out when we use the multi-threaded progress dialog again
				if (m_owner != null)
					m_owner.Enabled = true;

				if (m_progressDialog != null)
				{
					if (m_progressDialog.InvokeRequired)
						m_progressDialog.BeginInvoke(new MethodInvoker(m_progressDialog.Dispose));
					else
						m_progressDialog.Dispose();
				}
			}

			m_progressDialog = null;
			m_Exception = null;
			m_owner = null;

			m_fDisposed = true;
		}