private void ExportToHtml() { m_ElapsedTimeLabel.Text = null; NStopwatch stopwatch = NStopwatch.StartNew(); using (MemoryStream stream = new MemoryStream()) { m_RichText.SaveToStream(stream, new NHtmlTextFormat()); stopwatch.Stop(); LoadHtmlSource(stream); } m_ElapsedTimeLabel.Text = "Export done in: " + stopwatch.ElapsedMilliseconds.ToString() + " ms."; }
void OnEvaluateAllButtonClick(NEventArgs arg) { NList <string> tests = new NList <string>(); INIterator <NNode> it = m_TestsTreeView.GetSubtreeIterator(); while (it.MoveNext()) { NTreeViewItem item = it.Current as NTreeViewItem; if (item == null || item.Tag == null || !(item.Tag is string)) { continue; } tests.Add((string)item.Tag); } NStopwatch stopwatch = new NStopwatch(); stopwatch.Start(); int itcount = 10000; for (int j = 0; j < itcount; j++) { for (int i = 0; i < tests.Count; i++) { try { m_FormulaEngine.Evaluate(tests[i]); } catch (Exception ex) { m_ResultTextBox.Text = "Failed on test: " + tests[i] + ". Error was: " + ex.Message; m_InputTextBox.Text = tests[i]; return; } } } stopwatch.Stop(); int ms = stopwatch.ElapsedMilliseconds; m_ResultTextBox.Text = tests.Count + " tests performed " + itcount + " times in: " + ms + " milliseconds."; }
private void ExportToHtml() { m_ElapsedTimeLabel.Text = null; NStopwatch stopwatch = NStopwatch.StartNew(); using (MemoryStream stream = new MemoryStream()) { // Create and configure HTML save settings NHtmlSaveSettings saveSettings = new NHtmlSaveSettings(); saveSettings.InlineStyles = m_InlineStylesCheckBox.Checked; saveSettings.MinifyHtml = m_MinifyHtmlCheckBox.Checked; // Save to HTML m_RichText.SaveToStream(stream, new NHtmlTextFormat(), saveSettings); stopwatch.Stop(); LoadHtmlSource(stream); } m_ElapsedTimeLabel.Text = "Export done in: " + stopwatch.ElapsedMilliseconds.ToString() + " ms."; }