Exemple #1
0
        public static ICollection <string> GetListOfRunningProcesses(bool distinct = false)
        {
            ICollection <string> processNameList = new List <string>();

            System.Diagnostics.Process[] ps =
                System.Diagnostics.Process.GetProcesses();
            foreach (System.Diagnostics.Process p in ps)
            {
                try
                {
                    processNameList.Add(p.ProcessName);
                }
                catch (Exception)
                {
                    // エラーを残す方法を考える
                }
            }
            if (distinct)
            {
                return(ListFactory.Distinct(processNameList));
            }
            return(processNameList);
        }
Exemple #2
0
 public static ICollection <double> CreateErrorList(IEnumerable <double> list, double errorValue)
 {
     return(ListFactory.ConvertList(list, (n) => n + errorValue));
 }