public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { Debug.Assert(values.Length == 2, "Precondition violated: Must pass exactly 1 value into this converter."); if (values[0] is TimeTillCompletionEstimationsCollection estimations && values[1] is ConfigurationMode mode) { return(factory.FromTimeTillCompletionEstimations(estimations, mode, culture)); } return(DependencyProperty.UnsetValue); }
/// <exception cref="System.ArgumentException">Thrown when <paramref name="workEstimates"/> doesn't contain at least 1 simulation.</exception> public void Write(TimeTillCompletionEstimationsCollection workEstimates, ConfigurationMode configurationMode) { if (workEstimates.Count == 0) { throw new ArgumentException("Work estimations should have at least 1 simulation.", nameof(workEstimates)); } DataView dataView = factory.FromTimeTillCompletionEstimations( workEstimates, configurationMode, CultureInfo.InvariantCulture); WriteHeader(dataView.Table.Columns); WriteRows(dataView); }
public void GIVEN_time_till_completion_estimations_null_WHEN_creating_data_view_THEN_ThrowArgumentException() { void Call() => factory.FromTimeTillCompletionEstimations(null, default, CultureInfo.InvariantCulture);