private static IMediaFileIterator createIterator(Options options, MediaFile[] files) { IMediaFileIterator mediaFiles; switch (options.SortOrder) { default: case SortOrder.Default: mediaFiles = new OrderedIterator(files); break; case SortOrder.Random: mediaFiles = new RandomIterator(files, false); break; case SortOrder.RandomContinue: mediaFiles = new RandomIterator(files, true); break; case SortOrder.ByName: mediaFiles = new SoredByNameIterator(files); break; } return(mediaFiles); }
public static void TestRandomGeneratorIterator() { int randomValue = 0; Console.WriteLine("Test Random generator Iterator: "); dh.StartWatch(); RandomIterator randomIterator = new RandomIterator(10000, 1, 10); for (long i = 0; i < 20000000000; i++) { randomValue = randomIterator.Next(); } dh.StoptWatch(); Console.WriteLine(dh.GetMessage()); }