コード例 #1
0
 public void AddRange(IEnumerable <T> enumerable)
 {
     if (enumerable is IList)
     {
         Source.AddRange((IList)enumerable);
     }
     else
     {
         Source.AddRange(enumerable.ToList());
     }
 }
コード例 #2
0
        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());
            }
        }
コード例 #3
0
 public void AddRange(IEnumerable <TTarget> enumerable)
 {
     source.AddRange(enumerable.Select(t => toSource(t)));
 }