public void removeDeadXmlDoc(string docname) { try { XmlDocument doc = xmlFiles[docname]; xmlFiles.Remove(docname); } catch (KeyNotFoundException) { MB.S("removeDeadXmlDoc(): attempted to delete nonexistent XmlDocument " + docname); } }
public PmGraph() { SuspendLayout(); this.Text = "Pmgraph - Pmbench XML result reader"; Point originPoint = new Point(0, 0); this.MinimumSize = new Size(500, 400); this.MaximumSize = new Size( Screen.GetWorkingArea(originPoint).Width, Screen.GetWorkingArea(originPoint).Height); this.Size = new Size(780, 580); controlPanel = new ControlPanel(this); Controls.Add(controlPanel); xmlFiles = new Dictionary <string, XmlDocument>(); harness = new Harness(this); // initialize pivotchart Chart newchart = harness.rebuildAndGetNewChart( calculateChartWidth(), calculateChartHeight()); if (newchart == null) { MB.S("PmGraph: null chart returned"); System.Windows.Forms.Application.Exit(); } attachChart(newchart); this.Resize += (sender, arg) => { if (Controls.Contains(currentChart)) { currentChart.Width = calculateChartWidth(); currentChart.Height = calculateChartHeight(); //currentChart.Refresh(); } }; ResumeLayout(); }
/* * Hard redraw of chart- basically remove/recreate/reattach chart.. */ public void redrawChart() { detachChart(); harness.destroyPivotChart(); Chart newchart = harness.rebuildAndGetNewChart( calculateChartWidth(), calculateChartHeight()); if (newchart == null) { MB.S("redrawChart: null chart returned"); } attachChart(newchart); }