/// <summary> /// This returns the single process whose processID is equal to the savedWindow passed in. /// </summary> /// <param name="window"></param> /// <returns></returns> public static Process getProcessByWindowId(SavedActiveWindow window) { if (window.processId != 0) { return Process.GetProcessById(window.processId); } else { return null; } }
public static List<SavedActiveWindow> Get_Processes() { IEnumerable<Process> currentProcesses; List<SavedActiveWindow> savedProcesses = new List<SavedActiveWindow>(); currentProcesses = filterUsableProcesses(); //TODO: redesign this area with linq, cause I think we can return an Ienumerable of saved windowds faster foreach (Process proc in currentProcesses) { SavedActiveWindow window = new SavedActiveWindow(proc); savedProcesses.Add(window); } return savedProcesses; }