private void UpdateDangerProcessList(AntivirusLibrary.Events.AddDangerProcessEventArgs e) { List <AntivirusLibrary.ProcessDange> newList; if (e.Status) { newList = new List <AntivirusLibrary.ProcessDange>(dangerProcessList.Select(x => (AntivirusLibrary.ProcessDange)x.Clone())); } else { newList = new List <AntivirusLibrary.ProcessDange>(); } if (antivirusWorker.DangerProcess.Count != 0) { AntivirusLibrary.ProcessDange[] copyDangerFile = antivirusWorker.DangerProcess.Where(x => !newList.Select(y => y.Process.ProcessName).ToArray().Contains(x.Process.ProcessName)).ToArray(); for (int i = 0; i < copyDangerFile.Length; i++) { newList.Add((AntivirusLibrary.ProcessDange)copyDangerFile[i].Clone()); } } else { newList = new List <AntivirusLibrary.ProcessDange>(); } DangerProcessList = newList; }
public void UpdateDangerFiles(object sender, AntivirusLibrary.Events.AddDangerProcessEventArgs e) { UpdateDangerProcessList(e); }