Exemplo n.º 1
0
        internal static ParallelQuery <Change <TObject, TKey> > Parallelise <TObject, TKey>(this IChangeSet <TObject, TKey> source, ParallelisationOptions option)
        {
            switch (option.Type)
            {
            case ParallelType.Parallelise:
                return(source.AsParallel());

            case ParallelType.Ordered:
                return(source.AsParallel().AsOrdered());

            default:
                throw new ArgumentException("Should not parallelise!  Call ShouldParallelise() first");
            }
        }