コード例 #1
0
        //only turned on if closed with pubg is checked
        //closes after pubg closes
        private void timer1_Tick(object sender, EventArgs e)
        {
            bool pubgClosed = true;

            Process[] proc = Process.GetProcesses();
            foreach (Process item in proc)
            {
                if (item.ProcessName.Equals("TslGame"))
                {
                    pubgStarted = true;
                    pubgClosed  = false;
                }
            }
            if (pubgStarted && pubgClosed)
            {
                updateSettings();
                if (!Properties.Settings.Default.profilePath.Equals(""))
                {
                    NoReciolScript.killLogiDriver();
                    NoReciolScript.resetProfileDefualt();
                    NoReciolScript.startLogiDriver();
                }
                Environment.Exit(0);
            }
        }
コード例 #2
0
        //when the form close
        private async void Form1_FormClosingAsync(object sender, FormClosingEventArgs e)
        {
            if (firstClosingBlocked)
            {
                firstClosingBlocked = false;
                e.Cancel            = true;
                updateSettings();
                if (!Properties.Settings.Default.profilePath.Equals(""))
                {
                    NoReciolScript.killLogiDriver();
                    NoReciolScript.resetProfileDefualt();
                    NoReciolScript.startLogiDriver();
                }
                await PutTaskDelay(1000);

                Environment.Exit(0);
            }
        }