Beispiel #1
0
        static bool gameRunning()
        {
            int gameRun = 0;
            if (File.Exists(@"gameList.txt")) {} else {
                UpdateWindow updateForm = new UpdateWindow();
                updateForm.Show();
                System.Threading.Thread.Sleep(2000);
            }
            string[] games = System.IO.File.ReadAllLines(@"gameList.txt");
            Process[] processes = Process.GetProcesses();
            string[] proc = processes.Select(o => o.ToString()).ToArray();
            var intersect = games.Intersect(proc);

                foreach (string g in games)
                {
                    if (CheckIfProcessIsRunning(g))
                    {
                        gameRun++;
                        Console.WriteLine(gameRun);
                        Console.WriteLine(g);
                        return true;
                    }
                }
            if (gameRun > 0) { return true; } else { return false; }
        }
Beispiel #2
0
 private void metroTile2_Click(object sender, EventArgs e)
 {
     if (File.Exists(@"gameList.txt"))
     {
         Process.Start(@"gameList.txt");
     }
     else
     {
         UpdateWindow updateForm = new UpdateWindow();
         updateForm.Show();
     }
 }
Beispiel #3
0
 private void metroTile1_Click(object sender, EventArgs e)
 {
     UpdateWindow updateForm = new UpdateWindow();
     updateForm.Show();
 }