void IMetric <T> .Add(T data) { if (_selector(data)) { _metric.Add(data); } }
public void Add(TBase data) { IEnumerable <TSub> subInput = _selector(data).Where(s => _filter(data, s)); foreach (TSub subItem in subInput) { _metric.Add(subItem); } }
void IResultsAggregator.TestContextResultReceived(IResult result) { foreach (ICheckpoint checkpoint in result.Checkpoints) { if (checkpoint.Error != null) { string existingTextBoxValue = tbErrors.Text; if (existingTextBoxValue.Length > 10000) { existingTextBoxValue = existingTextBoxValue.Substring(0, 10000); } string newText = $"{DateTime.Now.ToString("O")} {checkpoint.Name}\r\n{checkpoint.Error}\r\n\r\n"; tbErrors.Invoke(new InvokeDelegate(() => tbErrors.Text = newText + existingTextBoxValue)); } } _metricMultiplexer.Add(result); }
private void _backgroundWorker1_ProgressChanged(object sender, System.ComponentModel.ProgressChangedEventArgs e) { IResult result; while (_resultsQueue.TryDequeue(out result)) { _metrics.Add(result); foreach (ICheckpoint checkpoint in result.Checkpoints) { if (checkpoint.Error != null) { AppendMessage($"{checkpoint.Name}\r\n{checkpoint.Error}"); } } } string jsonResult = JsonConvert.SerializeObject(GetData(), Formatting.Indented); resultsTextBox.Text = jsonResult; RefreshWindowTitle(); }