예제 #1
0
 void TopContext_Received(object sender, TopSnapshot top)
 {
     this.SafeInvoke(() =>
     {
         if (this.processesUpdated)
         {
             this.processesUpdated = false;
             this.UpdateProcessList();
             this.UpdateThreadList();
             this.UpdateControlState();
         }
         this.UpdateCpuUsage(top);
     });
 }
예제 #2
0
        void UpdateCpuUsage(TopSnapshot top)
        {
            foreach (var p in this.processList)
            {
                p.SetCpuUsage(top.GetProcessCpu(p.Pid));
            }
            this.uxProcessGridPanel.SortColumn(this.uxProcessGridPanel.SortedColumn, this.uxProcessGridPanel.SortOrder == SortOrder.Descending ? ListSortDirection.Descending : ListSortDirection.Ascending);

            foreach (var t in this.threadList)
            {
                t.SetCpuUsage(top.GetThreadCpu(t.Tid));
            }
            this.uxThreadGridPanel.SortColumn(this.uxThreadGridPanel.SortedColumn, this.uxThreadGridPanel.SortOrder == SortOrder.Descending ? ListSortDirection.Descending : ListSortDirection.Ascending);

            this.lastTop = top;
        }