/// <summary>
        /// Runs the operation async.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="method">The method.</param>
        /// <param name="bPreserveThreadCulture">If true, the background thread's culture will be set to the culture of the invoking thread</param>
        /// <param name="arguments">The arguments.</param>
        /// <returns></returns>
        public object RunOperationAsync(Form owner, DoBackgroundWork method, bool bPreserveThreadCulture, params object[] arguments)
        {
            m_method = method;
            m_args   = arguments;
            if (this.Visible)
            {
                this.Hide();
            }

            if (bPreserveThreadCulture)
            {
                m_culture = Thread.CurrentThread.CurrentCulture;
            }

            if (this.ShowDialog(owner) == DialogResult.OK)
            {
                return(m_result);
            }
            else
            {
                throw new CancelException();
            }
        }
Example #2
0
 /// <summary>
 /// Runs the operation async.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="method">The method.</param>
 /// <param name="arguments">The arguments.</param>
 /// <returns></returns>
 public object RunOperationAsync(Form owner, DoBackgroundWork method, params object[] arguments)
 {
     return RunOperationAsync(owner, method, true, arguments);
 }
 /// <summary>
 /// Runs the operation async.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="method">The method.</param>
 /// <param name="arguments">The arguments.</param>
 /// <returns></returns>
 public object RunOperationAsync(Form owner, DoBackgroundWork method, params object[] arguments)
 {
     return(RunOperationAsync(owner, method, true, arguments));
 }
Example #4
0
        /// <summary>
        /// Runs the operation async.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="method">The method.</param>
        /// <param name="bPreserveThreadCulture">If true, the background thread's culture will be set to the culture of the invoking thread</param>
        /// <param name="arguments">The arguments.</param>
        /// <returns></returns>
        public object RunOperationAsync(Form owner, DoBackgroundWork method, bool bPreserveThreadCulture, params object[] arguments)
        {
            m_method = method;
            m_args = arguments;
            if (this.Visible)
                this.Hide();

            if (bPreserveThreadCulture)
                m_culture = Thread.CurrentThread.CurrentCulture;

            if (this.ShowDialog(owner) == DialogResult.OK)
                return m_result;
            else
                throw new CancelException();
        }