public DiffCallTreeForm(TreeNodeBase root, AllocationDiff allocDiff)
        {
            this.Root       = root;
            this._allocDiff = allocDiff;

            InitForm();
        }
示例#2
0
        private void buildReports()
        {
            try
            {
                switch (graphtype)
                {
                case Graph.GraphType.AllocationGraph:
                    _allocDiff = new AllocationDiff();
                    _allocDiff.PrevLogFileName = f.prevlogFileName;
                    _allocDiff.CurrLogFileName = f.currlogFileName;
                    _allocDiff.diffLogFileName = f.difflogFileName;
                    _allocDiff.BuildAllocationDiffTable();
                    if (!f.noUI)
                    {
                        this.txtbPrevlog.Text = f.prevlogFileName;
                        this.txtbCurrlog.Text = f.currlogFileName;
                        AlloccationDiff2Window();
                    }
                    else
                    {
                        AlloccationDiff2Console();
                    }
                    break;
                }
            }
            catch (Exception e)
            {
                if (!f.noUI)
                {
                    MessageBox.Show(e.Message, "Report profiler Error message");
                    throw new Exception(e.Message + "\n");
                }
                else
                {
                    if (_allocDiff.diffLogFileName != null)
                    {
                        int at = _allocDiff.diffLogFileName.LastIndexOf(".");
                        _allocDiff.diffLogFileName  = _allocDiff.diffLogFileName.Substring(0, at);
                        _allocDiff.diffLogFileName += ".err";
                        if (File.Exists(_allocDiff.diffLogFileName))
                        {
                            File.Delete(_allocDiff.diffLogFileName);
                        }

                        var fs = new FileStream(_allocDiff.diffLogFileName,
                                                FileMode.CreateNew, FileAccess.Write, FileShare.None);
                        var sw = new StreamWriter(fs);
                        sw.WriteLine("Report profiler Error message: \n{0}\n", e.Message);
                        sw.Close();
                    }
                    else
                    {
                        Console.WriteLine("Report profiler Error message: \n{0}\n", e.Message);
                    }
                    throw new Exception(e.Message + "\n");
                }
            }
        }
示例#3
0
        public DiffCallTreeForm([NotNull] TreeNodeBase root, [NotNull] AllocationDiff allocDiff)
        {
            this.Root       = root;
            this._allocDiff = allocDiff;

            Controls.Clear();
            controlCollection?.Controls.Clear();
            InitializeComponent();
            defaultFont = new Font(new FontFamily("Tahoma"), 8);

            var treeView = new DiffTreeListView(this);

            treeView.Dock = DockStyle.Fill;
            treeView.Font = defaultFont;

            var sort      = new SortingBehaviour(sortingOrder: -1, counterId: -1);
            var highlight = new SortingBehaviour(sortingOrder: -1, counterId: 2);

            /* add columns */
            treeView.AddColumn(new ColumnInformation(-1, "Function name", ColumnInformation.ColumnTypes.Tree), 250);
            foreach (int counter in DiffStatistics.DefaultCounters)
            {
                AddColumn(treeView, counter);
            }

            treeView.ColumnClick += new EventHandler(SortOn);

            treeView.ViewState = new ViewState(sort, highlight);
            treeView.Root      = Root;


            treeView.Size    = new System.Drawing.Size(332, 108);
            treeView.Visible = true;
            controlCollection.Controls.Add(treeView);
            SetcallTreeView();
            this.Visible = true;
        }