Exemplo n.º 1
0
        internal SortAndHighlightSelector(CallTreeForm.SortingBehaviour sort, CallTreeForm.SortingBehaviour highlight)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            int i, numCounters = Statistics.GetNumberOfCounters();

            sortCounter.Items.Add("in order of execution");
            for (i = 0; i < numCounters; i++)
            {
                sortCounter.Items.Add("by " + Statistics.GetCounterName(i).ToLower());
            }
            sortCounter.SelectedIndex = 1 + sort.counterId;
            sortOrder.SelectedIndex   = (1 + sort.sortingOrder) / 2;

            for (i = 0; i < numCounters; i++)
            {
                highlightCounter.Items.Add(Statistics.GetCounterName(i).ToLower());
            }
            highlightCounter.SelectedIndex = highlight.counterId;
            highlightOrder.SelectedIndex   = (1 + highlight.sortingOrder) / 2;
        }
Exemplo n.º 2
0
        public SelectColumns()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //

            checkBoxes = new ArrayList();

            Hashtable underscored = new Hashtable();

            int numCounters = Statistics.GetNumberOfCounters();

            for (int i = 0; i < numCounters; i++)
            {
                string text = Statistics.GetCounterName(i);
                for (int j = 0; j < text.Length; j++)
                {
                    if (!Char.IsLetter(text, j))
                    {
                        continue;
                    }

                    char c = Char.ToLower(text[j]);
                    if (!underscored.ContainsKey(c))
                    {
                        underscored.Add(c, null);
                        text = text.Substring(0, j) + "&" + text.Substring(j);
                        break;
                    }
                }

                int px = (i % 2) == 1 ? Width / 2 : 16, py = 56;
                if (i > 1)
                {
                    py = ((CheckBox)checkBoxes[i - 2]).Bottom;
                }

                CheckBox box = new CheckBox();
                box.Parent   = this;
                box.Visible  = true;
                box.Location = new Point(px, py);
                box.Width    = Width / 2 - 10;
                box.Text     = text;
                box.BringToFront();

                checkBoxes.Add(box);
            }
        }