public void AddRange(IEnumerable <T> enumerable) { if (enumerable is IList) { Source.AddRange((IList)enumerable); } else { Source.AddRange(enumerable.ToList()); } }
private void SetIndependendFunctionValues(IVariable variable, IVariableFilter[] filters, IEnumerable values) { IMultiDimensionalArray array = FunctionValues[functions.IndexOf(variable)]; if (filters.Length != 0) { throw new ArgumentException("don't use filters to set independend variables. the only exception is an index filter with index equal to count"); } if (values is IList) { array.AddRange((IList)values); } else { array.AddRange(values.Cast <object>().ToList()); } }
public void AddRange(IEnumerable <TTarget> enumerable) { source.AddRange(enumerable.Select(t => toSource(t))); }