Esempio n. 1
0
        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;
 }
Esempio n. 3
0
 public CacheItem(DateTime age, ProcessInformationList processInformationList)
 {
     _Age = age;
     _ProcessInformationList = processInformationList;
 }