示例#1
0
        public static void AddToWhitelist(int PID, string name, string path)
        {
            var app = new WhitelistedApp
            {
                Name = name,
                Path = path
            };

            using (var db = new ArgonDB())
                try {
                    db.InsertAsync(app);
                }
                catch { }

            CpuSuspendWhitelist.Add(app);
            SuspendedProcessList.RemoveAll(x => x.ID == PID);
        }
示例#2
0
        public static bool ResumeProcess(int PID)
        {
            bool success = false;

            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                try {
                    success = PInvokes.DebugActiveProcessStop(Convert.ToUInt32(PID));
                    if (success)
                    {
                        SuspendedProcessList.RemoveAll(x => x.ID == PID);
                        ((MainWindow)Application.Current.MainWindow).SuspendedProcesses.UpdateViewSource();
                    }
                }
                catch { }
            })).Wait();

            return(success);
        }
示例#3
0
        public static bool SuspendProcess(int PID)
        {
            if (ProcessDataList.First(x => x.ID == PID).IsProtected)
            {
                return(false);
            }

            bool success = false;

            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                try {
                    success = PInvokes.DebugActiveProcess(Convert.ToUInt32(PID));
                    if (success)
                    {
                        SuspendedProcessList.Add(ProcessDataList.First(x => x.ID == PID));
                        ((MainWindow)Application.Current.MainWindow).SuspendedProcesses.UpdateViewSource();
                    }
                }
                catch { }
            })).Wait();

            return(success);
        }