//constructor public Enumerator(ProcessInfoCollection procCollection) { position = -1; processCollection = procCollection; }
private Dictionary<int, bool> threadViewAscendingSort; //used to determine if a given columns is sorted and in what direction #endregion Fields #region Constructors public MainGui() { InitializeComponent(); mainStrings = new ResourceManager(typeof(Properties.Resources)); genProcessData = new GeneralProcessData(); //currently diaplyed general information selectedGeneralInformation = new List<string>(); selectedGeneralInformation.AddRange(new string[] { genProcessData.GeneralStrings.GetString("physicalMem"), genProcessData.GeneralStrings.GetString("virtualMem"), genProcessData.GeneralStrings.GetString("timeInGC"), genProcessData.GeneralStrings.GetString("processDescription"), genProcessData.GeneralStrings.GetString("cpuUsage"), genProcessData.GeneralStrings.GetString("cpuTime"), genProcessData.GeneralStrings.GetString("managedHeap")} ); //array of label objects to populate general data into it labelGroup = new List<Label>(); labelGroup.AddRange(new Label[] { label1, label2, label3, label4, label5, label6, label7, label8, label9, label10,label11,label12}); //initialize priorities priorityPosition = new Dictionary<ProcessPriorityClass, int>(); priorityPosition[ProcessPriorityClass.RealTime] = 0; priorityPosition[ProcessPriorityClass.High] = 1; priorityPosition[ProcessPriorityClass.AboveNormal] = 2; priorityPosition[ProcessPriorityClass.Normal] = 3; priorityPosition[ProcessPriorityClass.BelowNormal] = 4; priorityPosition[ProcessPriorityClass.Idle] = 5; //set up sorting process columns processViewAscendingSort = new Dictionary<int, bool>(); processViewAscendingSort[(int)ProcessColumnsEnum.Process] = false; processViewAscendingSort[(int)ProcessColumnsEnum.ID] = false; //set up sorting for thread columns threadViewAscendingSort = new Dictionary<int, bool>(); threadViewAscendingSort[(int)ThreadColumnsEnum.ID] = false; threadViewAscendingSort[(int)ThreadColumnsEnum.Reason] = false; threadViewAscendingSort[(int)ThreadColumnsEnum.State] = false; listProcessIds = new List<int>();//list of process ids listThreadIds = new List<int>(); //list of thread ids monitorList = new Dictionary<int, List<int>>();//maping of process ids to threads beings logged monitorFiles = new Dictionary<int, string>();//mapping of process id to file name to save log to threadSelectedIdList = new List<int>(); //currently selected threads processes = ProcessInfoCollection.SingleProcessCollection; currentlySelectedProcess = -1; rightPanelWidth = -1; prefForm = new PreferenceForm(); try { //customizable preferences //this is where I will read from the settings file and get last saved data //default preferences processListRefreshRate = Properties.Settings.Default.processRefreshRate; threadListRefreshRate = Properties.Settings.Default.threadRefreshRate; stackRefreshRate = Properties.Settings.Default.stackRefreshRate; loggingRate = Properties.Settings.Default.loggingRate; stackTraceDepth = Properties.Settings.Default.stackDepth; } catch (FileNotFoundException) { } //set the timer interval processRefreshTimer.Interval = processListRefreshRate; threadRefreshTimer.Interval = threadListRefreshRate; stackRefreshTimer.Interval = stackRefreshRate; stackLogTimer.Interval = loggingRate; }