public static void GetMemoryUsedByProcessById(int pid, Label memoryLabel) { var processName = ProcessesData.Find(x => x.Id.Equals(pid)).ProcessName; int i = 0; foreach (var instanceProcess in ProcessesData.FindAll(x => x.ProcessName.Equals(processName))) { if ((instanceProcess.Id == pid) & (i > 0)) { memoryLabel.Text = MemoryUsedByProcess(processName + "#" + i) + " / " + BytesToReadableValue(ProcessesData.Find(x => x.Id.Equals(pid)).PrivateMemorySize64); } else if (instanceProcess.Id == pid) { memoryLabel.Text = MemoryUsedByProcess(processName) + " / " + BytesToReadableValue(ProcessesData.Find(x => x.Id.Equals(pid)).PrivateMemorySize64); } i++; } }
private void GetAppConfigFileComplete(string result) { Debug.Log(result); ProcessesData processes = JsonUtil.Deserialize <ProcessesData>(result); bool running = false; for (int i = 0; i < processes.Processes.Count; i++) { ProcessData data = processes.Processes[i]; if (data.AppName != null && (data.AppName == SpectatorViewAppName)) { running = true; break; } } panel.hololensStatusPanel.ShowAppRunning(running); }