1.1 --- a/tools/profiler/csharp/Form1.cs Fri Jul 11 06:51:21 2008 +0000
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,98 +0,0 @@
1.4 -using System;
1.5 -using System.Collections.Generic;
1.6 -using System.ComponentModel;
1.7 -using System.Data;
1.8 -using System.Drawing;
1.9 -using System.Text;
1.10 -using System.Windows.Forms;
1.11 -
1.12 -namespace profviewer
1.13 -{
1.14 - public partial class Main : Form
1.15 - {
1.16 - private ProfileReport m_Report;
1.17 -
1.18 - public Main()
1.19 - {
1.20 - InitializeComponent();
1.21 - }
1.22 -
1.23 - private void menu_file_open_Click(object sender, EventArgs e)
1.24 - {
1.25 - DialogResult res;
1.26 -
1.27 - res = dialog_open.ShowDialog(this);
1.28 -
1.29 - if (res != DialogResult.OK)
1.30 - {
1.31 - return;
1.32 - }
1.33 -
1.34 - m_Report = null;
1.35 -
1.36 - try
1.37 - {
1.38 - m_Report = new ProfileReport(dialog_open.FileName);
1.39 - }
1.40 - catch (System.Exception ex)
1.41 - {
1.42 - MessageBox.Show("Error opening or parsing file: " + ex.Message);
1.43 - }
1.44 -
1.45 - UpdateListView();
1.46 - }
1.47 -
1.48 - private void UpdateListView()
1.49 - {
1.50 - ProfileItem atom;
1.51 - ListViewItem item;
1.52 -
1.53 - if (m_Report == null)
1.54 - {
1.55 - report_list.Items.Clear();
1.56 - report_info_duration.Text = "";
1.57 - report_info_starttime.Text = "";
1.58 - return;
1.59 - }
1.60 -
1.61 - report_info_duration.Text = m_Report.Duration.ToString() + " seconds";
1.62 - report_info_starttime.Text = m_Report.StartTime.ToString();
1.63 -
1.64 - for (int i = 0; i < m_Report.Count; i++)
1.65 - {
1.66 - atom = m_Report.GetItem(i);
1.67 - item = new ListViewItem(ProfileReport.TypeStrings[(int)atom.type]);
1.68 -
1.69 - item.SubItems.Add(atom.name);
1.70 - item.SubItems.Add(atom.num_calls.ToString());
1.71 - item.SubItems.Add(atom.AverageTime.ToString("F6"));
1.72 - item.SubItems.Add(atom.min_time.ToString("F6"));
1.73 - item.SubItems.Add(atom.max_time.ToString("F6"));
1.74 - item.SubItems.Add(atom.total_time.ToString("F6"));
1.75 -
1.76 - report_list.Items.Add(item);
1.77 - }
1.78 - }
1.79 -
1.80 - private void menu_file_exit_Click(object sender, EventArgs e)
1.81 - {
1.82 - Application.Exit();
1.83 - }
1.84 -
1.85 - private void report_list_ColumnClick(object sender, ColumnClickEventArgs e)
1.86 - {
1.87 - if (e.Column == 1)
1.88 - {
1.89 - report_list.ListViewItemSorter = new LIStringComparator(1);
1.90 - }
1.91 - else if (e.Column == 2)
1.92 - {
1.93 - report_list.ListViewItemSorter = new LIIntComparator(2);
1.94 - }
1.95 - else if (e.Column > 2)
1.96 - {
1.97 - report_list.ListViewItemSorter = new LIDoubleComparator(e.Column);
1.98 - }
1.99 - }
1.100 - }
1.101 -}
1.102 \ No newline at end of file