Exemple #1
0
        /// <summary>
        /// Add the Main Form thread to the thread list and start it
        /// </summary>
        public void StartMainWindowThread()
        {
            if (_mainFormThread != null)
            {
                return;
            }

            _logger.Debug("Starting main form thread");

            var t = new SynchronizedThread(() =>
            {
                try
                {
                    MainWindow.ShowDialogTopMost();
                    _mainFormThread = null;
                }
                catch (Exception ex) { _logger.Error(ex); }
            });

            _mainFormThread      = t;
            _mainFormThread.Name = "MainFormThread";
            _mainFormThread.SetApartmentState(ApartmentState.STA);

            StartSynchronizedThread(t);
        }
        private void StartProcessing()
        {
            if (_jobInfoQueue.IsEmpty && !_managePrintJobs)
            {
                return;
            }

            _processingThread = new SynchronizedThread(ProcessJobs) { Name = "ProcessingThread" };
            _processingThread.SetApartmentState(ApartmentState.STA);

            _threadManager.StartSynchronizedThread(_processingThread);
        }