public DiffCallTreeForm(TreeNodeBase root, AllocationDiff allocDiff) { this.Root = root; this._allocDiff = allocDiff; InitForm(); }
private void buildReports() { try { switch(graphtype) { case Graph.GraphType.AllocationGraph: _allocDiff = new AllocationDiff (); _allocDiff.PrevLogFileName = f.prevlogFileName; _allocDiff.CurrLogFileName = f.currlogFileName; _allocDiff.BuildAllocationDiffTable(); if(f.runaswindow) { this.txtbPrevlog.Text = f.prevlogFileName; this.txtbCurrlog.Text = f.currlogFileName; AlloccationDiff2Window(); } else { AlloccationDiff2Console(); } break; } } catch(Exception e) { if(f.runaswindow) { 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); FileStream fs = new FileStream(_allocDiff.diffLogFileName, FileMode.CreateNew, FileAccess.Write, FileShare.None); StreamWriter 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"); } } }