Exemplo n.º 1
0
        private void StartSystemStatsThread()
        {
            Thread statsCheckThread = new Thread(StartUpdatingSystemStats);

            AppThreadManager.AddThread(statsCheckThread);
            statsCheckThread.Start();
        }
Exemplo n.º 2
0
        private void CreateProcess()
        {
            if (isProcessStarted)
            {
                return;
            }
            Process newProcess = ProcessManager.StartProcess(10000);

            if (newProcess != null)
            {
                isProcessStarted = true;
            }
            ProgressReportingInvoker pri = new ProgressReportingInvoker(
                () => { ProcessManager.KillProcess(newProcess.Id.ToString()); isProcessStarted = false; },
                this,
                new Func <string, bool>(IsProcessAlive));


            Thread newProcessThread = new Thread(() => pri.Start(10000, newProcess.Id.ToString()));

            AppThreadManager.AddThread(newProcessThread);
            newProcessThread.Start();
        }
Exemplo n.º 3
0
 private void AddToManagedThreads(Thread t)
 {
     AppThreadManager.AddThread(t);
 }
Exemplo n.º 4
0
 private void CloseWindow()
 {
     AppThreadManager.TerminateEvery();
     System.Windows.Application.Current.Shutdown();
 }