示例#1
0
        /// <summary>
        ///     Initialize with NextUpdate and UpdateInterval from Settings
        /// </summary>
        /// <summary>
        ///     Launch UpdateProcedure in separate Thread.
        ///     UpdateManager must be initialized!
        ///     Downloads update-info.txt and compares the recent (online) version to the current version
        ///     and launches assigned events.
        ///     Specific Events must be set in advance.
        ///     Can only be launched once at the time, reported in UpdateProcedureIsRunning flag.
        ///     Resets the UpdateManager afterwards.
        /// </summary>
        /// <param name="checkNecessity"></param>
        /// <param name="onlyNotifyOnNewUpdate">When true, a message is only displayed to the user, if an update is available. Otherwise, a message will be displayed that no update is available</param>
        public void UpdateProcedure(bool checkNecessity, bool onlyNotifyOnNewUpdate)
        {
            _checkNecessity = checkNecessity;

            var thread = new SynchronizedThread(() => UpdateThread(onlyNotifyOnNewUpdate));

            thread.Name = "UpdateThread";
            thread.SetApartmentState(ApartmentState.STA);
            _threadManager.StartSynchronizedThread(thread);
        }
示例#2
0
        public static void ShowTopMost(int currentCount)
        {
            CurrentCount = currentCount;
            var thread = new SynchronizedThread(ShowPlusHintWindow)
            {
                Name = "PlusHintThread"
            };

            thread.SetApartmentState(ApartmentState.STA);

            ThreadManager.Instance.StartSynchronizedThread(thread);
        }
        public void Show(Job job)
        {
            if (!job.Profile.ShowProgress)
            {
                return;
            }

            var progressWindowThread = new SynchronizedThread(() => ShowConversionProgressDialog(job));

            progressWindowThread.SetApartmentState(ApartmentState.STA);

            progressWindowThread.Name = "ProgressForm";

            _threadManager.StartSynchronizedThread(progressWindowThread);
        }