public List <ReservationProcessInfoItem> GetReservationProcessInfos() { int reservationId; int resourceId; if (Reservation != null) { reservationId = Reservation.ReservationID; resourceId = Reservation.ResourceID; } else { reservationId = 0; resourceId = Resource.ResourceID; } List <ReservationProcessInfoItem> result; if (Helper.Context.Session[$"ReservationProcessInfos#{resourceId}"] == null) { var infos = Helper.Provider.Scheduler.ProcessInfo.GetReservationProcessInfos(reservationId); result = ProcessInfos.CreateReservationProcessInfoItems(infos); Helper.Context.Session[$"ReservationProcessInfos#{resourceId}"] = result; } else { result = (List <ReservationProcessInfoItem>)Helper.Context.Session[$"ReservationProcessInfos#{resourceId}"]; } return(result); }
//Level 4 is default -- after keywords public ProviderBrowser(Window parent, Action <string, string, string> update) { Owner = parent; m_keyStrings = new List <String>(); m_selectedKeys = new List <string>(); m_keys = new Dictionary <string, ProviderDataItem>(); m_processNames = new List <String>(); m_updateParent = update; m_level = "Verbose"; InitializeComponent(); ProviderNameFilter.Focus(); LevelListBox.Items.Add("Always"); LevelListBox.Items.Add("Critical"); LevelListBox.Items.Add("Error"); LevelListBox.Items.Add("Warning"); LevelListBox.Items.Add("Informational"); LevelListBox.Items.Add("Verbose"); LevelListBox.SelectedItem = "Verbose"; var processInfos = new ProcessInfos(); m_processNames.Add("*"); foreach (var process in processInfos.Processes) { // If the name is null, it is likely a system process, it will not have managed code, so don't bother. if (process.Name == null) { continue; } // if (process.ProcessID == myProcessId) // continue; /*// Only show processes with GC heaps. * if (!allProcs && !m_procsWithHeaps.ContainsKey(process.ProcessID)) * continue;*/ m_processNames.Add(process.ToString()); } ProcessNameListBox.ItemsSource = m_processNames; // Get Provider names m_providerNames = new List <String>(); foreach (Guid guid in TraceEventProviders.GetPublishedProviders()) { m_providerNames.Add(TraceEventProviders.GetProviderName(guid)); //keyStrings.Add(TraceEventProviders.GetProviderKeywords(guid).ToString()); } // setup GUI controls. ProviderNameListBox.ItemsSource = m_providerNames; KeyNameListBox.ItemsSource = m_keyStrings; }
private void ScanProc() { while (true) { try { _rescanForcedEvent.WaitOne(5000); //return value not used by design, just sleeping while someone forces rescan var source = _taskManager.GetProcesses(); if (source.Count == 0) { return; } foreach (var obj in source) { if (ProcessInfos.ContainsKey(obj.Key)) { Application.Current.Dispatcher.Invoke(() => { ReflectObjectInModel(obj.Value.Item1, ProcessInfos[obj.Key], obj.Value.Item2); }); } else { var pInfo = new ProcessInfo(); ReflectObjectInModel(obj.Value.Item1, pInfo, obj.Value.Item2); Application.Current.Dispatcher.Invoke(() => ProcessInfos.Add(pInfo.Id, pInfo)); } } var pInfoList = ProcessInfos.ToList(); foreach (var keyValuePair in pInfoList) { if (!source.ContainsKey(keyValuePair.Key)) { Application.Current.Dispatcher.Invoke(() => ProcessInfos.Remove(keyValuePair.Key)); } } ErrorMessage = string.Empty; } catch (Exception e) { ErrorMessage = e.Message; } } }
private void MakeProcessList() { var processInfos = new ProcessInfos(); var myProcessId = Process.GetCurrentProcess().Id; // TODO FIX NOW maek the call to GetProcessesWithGCHeaps async. var allProcs = AllProcsCheckBox.IsChecked ?? false; m_procsWithHeaps = null; if (!allProcs && m_procsWithHeaps == null) { m_procsWithHeaps = GCHeapDump.GetProcessesWithGCHeaps(); } // Create a list of processes, exclude myself m_processList = new List <ProcessInfo>(); foreach (var process in processInfos.Processes) { // If the name is null, it is likely a system process, it will not have managed code, so don't bother. if (process.Name == null) { continue; } if (process.ProcessID == myProcessId) { continue; } // Only show processes with GC heaps. if (!allProcs && !m_procsWithHeaps.ContainsKey(process.ProcessID)) { continue; } m_processList.Add(process); } m_processList.Sort(delegate(ProcessInfo x, ProcessInfo y) { // Sort by name var ret = string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase); if (ret != 0) { return(ret); } // Then by process ID return(x.ProcessID - y.ProcessID); }); Processes.ItemsSource = m_processList; FilterTextBox.Focus(); }
private void StartParentProcess(int processId, IUser user) { var processSteps = ProcessInfos.Where(x => x.ParentProcessId == processId); CreateProcesses(user, processSteps, processSteps.First().Id); }