Ejemplo n.º 1
0
        public void UpdateList(Proc NewProcess)
        {
            Proc OldProcess = ProcessList.FirstOrDefault(name => name.Name == NewProcess.Name); // Retoune le processus dans la liste.

            if (OldProcess != null)
            {
                int index = processList.IndexOf(OldProcess);
                ProcessList[index].Cpu = NewProcess.Cpu;
                ProcessList[index].Ram = NewProcess.Ram;
                return;
            }
            ProcessList.Add(NewProcess); //Si le processus n'est pas dans la liste, on l'ajoute.
        }
Ejemplo n.º 2
0
        public NavItem(NavigationItemInfo itemInfo, ProcessList procList)
        {
            if (itemInfo == null)
            {
                throw new ArgumentNullException("itemInfo");
            }

            if (procList == null)
            {
                throw new ArgumentNullException("procList");
            }

            Id = itemInfo.Id;
            Name = itemInfo.Name;
            SystemName = itemInfo.SystemName;
            ProcessSystemName = itemInfo.ProcessSystemName;
            Description = itemInfo.Description;
            BackgroundColor = ColorTranslator.ToHtml(Color.FromArgb((int)itemInfo.BackgroundColor));
            IsSystem = itemInfo.IsSystem;
            ProcessId = itemInfo.ProcessId;
            RuntimeId = itemInfo.RuntimeId;
            ProcessViewGuid = itemInfo.ProcessViewGuid;

            var processInfo = procList.FirstOrDefault(x => x.SystemName == this.SystemName);
            if (processInfo != null)
            {
                ProcessDescription = processInfo.ProcessDocumentation;
            }
        }