コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Shows an instance of this dialog on a separate thread.
        /// </summary>
        /// <param name="args">The application arguments</param>
        /// <param name="whatToWaitFor">The condition we're waiting for.</param>
        /// <param name="appToStart">The application to start.</param>
        /// <param name="appToWaitFor">The application to wait for (null if waiting for
        /// WindowToActivate).</param>
        /// ------------------------------------------------------------------------------------
        internal static void ShowOnSeparateThread(FwAppArgs args, WaitFor whatToWaitFor,
                                                  FwApp appToStart, FwApp appToWaitFor)
        {
            if (whatToWaitFor != WaitFor.WindowToActivate && appToWaitFor == null)
            {
                throw new ArgumentNullException("appToWaitFor");
            }
            if (appToStart == null)
            {
                throw new ArgumentNullException("appToStart");
            }

            ApplicationBusyDialog dlg = new ApplicationBusyDialog();

            dlg.m_whatToWaitFor = whatToWaitFor;
            dlg.m_args          = args;
            dlg.m_appToStart    = appToStart;
            dlg.m_appToWaitFor  = appToWaitFor;
            Thread thread = new Thread(dlg.WaitForOtherApp);

            thread.IsBackground = true;
            thread.SetApartmentState(ApartmentState.STA);
            thread.Name             = "WaitForOtherBusyApp";
            thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
            thread.Start();
        }
コード例 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Shows an instance of this dialog on a separate thread.
		/// </summary>
		/// <param name="args">The application arguments</param>
		/// <param name="whatToWaitFor">The condition we're waiting for.</param>
		/// <param name="appToStart">The application to start.</param>
		/// <param name="appToWaitFor">The application to wait for (null if waiting for
		/// WindowToActivate).</param>
		/// ------------------------------------------------------------------------------------
		internal static void ShowOnSeparateThread(FwAppArgs args, WaitFor whatToWaitFor,
			FwApp appToStart, FwApp appToWaitFor)
		{
			if (whatToWaitFor != WaitFor.WindowToActivate && appToWaitFor == null)
				throw new ArgumentNullException("appToWaitFor");
			if (appToStart == null)
				throw new ArgumentNullException("appToStart");

			ApplicationBusyDialog dlg = new ApplicationBusyDialog();
			dlg.m_whatToWaitFor = whatToWaitFor;
			dlg.m_args = args;
			dlg.m_appToStart = appToStart;
			dlg.m_appToWaitFor = appToWaitFor;
			Thread thread = new Thread(dlg.WaitForOtherApp);
			thread.IsBackground = true;
			thread.SetApartmentState(ApartmentState.STA);
			thread.Name = "WaitForOtherBusyApp";
			thread.CurrentUICulture = Thread.CurrentThread.CurrentUICulture;
			thread.Start();
		}