Example #1
0
        private void SaveHtmlReport()
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.Filter = "HTML Files (*.htm)|*.htm";

            if(dialog.ShowDialog() == DialogResult.OK) {
                PerformanceManager manager = new PerformanceManager();
                manager.Events = new Dictionary<string, PerformanceEvent>();

                foreach(PerformanceEvent perfEvent in performanceData) {
                    if(!manager.Events.ContainsKey(perfEvent.Name)) {
                        manager.Events.Add(perfEvent.Name, perfEvent);
                    }
                }

                if(!manager.GenerateHtmlSummary(dialog.FileName, null, false)) {
                    MessageBox.Show("Failed to save report.", "Error",
                                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Example #2
0
        private void PreviewHtmlReport()
        {
            if(performanceData == null) {
                // data not loaded yet
                return;
            }

            PerformanceManager manager = new PerformanceManager();
            manager.Events = new Dictionary<string, PerformanceEvent>();

            foreach(PerformanceEvent perfEvent in performanceData) {
                if(!manager.Events.ContainsKey(perfEvent.Name)) {
                    manager.Events.Add(perfEvent.Name, perfEvent);
                }
            }

            manager.GenerateHtmlSummary();
        }