示例#1
0
 private void DuplicateRow(TInput row)
 {
     if (row == null)
     {
         return;
     }
     OutputBuffer.SendAsync(row).Wait();
     LogProgress();
     for (int i = 0; i < NumberOfDuplicates; i++)
     {
         if (CanDuplicate?.Invoke(row) ?? true)
         {
             TInput copy = ObjectCopy.Clone(row);
             OutputBuffer.SendAsync(copy).Wait();
             LogProgress();
         }
     }
 }
示例#2
0
        private IEnumerable <TInput> DuplicateRow(TInput row)
        {
            if (row == null)
            {
                return(null);
            }
            List <TInput> result = new List <TInput>(NumberOfDuplicates);

            result.Add(row);
            LogProgress();
            for (int i = 0; i < NumberOfDuplicates; i++)
            {
                if (CanDuplicate?.Invoke(row) ?? true)
                {
                    TInput copy = ObjectCopy.Clone(row);
                    result.Add(copy);
                    LogProgress();
                }
            }
            return(result);
        }