Esempio n. 1
0
        private void ShowLabels(AppPerformanceInfo appPerformance, out double memValue)
        {
            //Labels
            label_cpu_usage.Text    = $@"{appPerformance.CpuUsage:F1} %";
            label_sys_mem.Text      = appPerformance.SystemMemoryInfo;
            label_thread_count.Text = appPerformance.ThreadCount.ToString();

            if (Environment.OSVersion.Version.Major >= 6)
            {
                label_mem_app.Text =
                    $@"{1.0 * appPerformance.AppPrivateMemory / Constants.MB_DIV:F1}MB";
                label_mem_workingset.Text =
                    $@"{1.0 * appPerformance.AppWorkingSetMemory / Constants.MB_DIV:F1}MB";
                memValue = appPerformance.AppPrivateMemory;
            }
            else
            {
                label_mem_app.Text = string.Format("{0:F1}MB", 1.0 * appPerformance.CpuUsage / Constants.MB_DIV);
                memValue           = appPerformance.AppWorkingSetMemory;
            }
        }
Esempio n. 2
0
 private void OnShowInfoAction(AppPerformanceInfo appPerformanceInfo)
 {
     _syncContext.Post(ShowInfoSafePost, appPerformanceInfo);
 }