private static void UpdateCache(string projectName) { ProcessInformationList list = new ProcessInformationList(); foreach (Process process in ManagedProcesses[projectName]) { try { list.Add(new ProcessInformation(process)); } catch // Catches all the old dead processes so that the above list is updated with only live processes { } } LockCookie lockCookie = readWriterLock.UpgradeToWriterLock(100); try { ManagedProcessInformationListCache[projectName].ProcessInformationList = list; } finally { readWriterLock.DowngradeFromWriterLock(ref lockCookie); } }
public ProcessInformation(ProcessInformationList children, int id, long pagedMemory, long privateMemory, string processName, String processorTime, long virtualMemory, string startTime) { _Children = children; _Id = id; _PagedMemory = pagedMemory; _PrivateMemory = privateMemory; _ProcessName = processName; _ProcessorTime = processorTime; _VirtualMemory = virtualMemory; _StartTime = startTime; }
public CacheItem(DateTime age, ProcessInformationList processInformationList) { _Age = age; _ProcessInformationList = processInformationList; }