Generate() public method

public Generate ( int amount ) : IEnumerable
amount int
return IEnumerable
Esempio n. 1
0
        private static void GeneratingSynchronously()
        {

            Console.WriteLine();
            Demo.DisplayHeader("Using synchronous enumerable");

            var generator = new MagicalPrimeGenerator();
            // this will block the main thread for a few seconds
            foreach (var prime in generator.Generate(5))
            {
                Console.Write("{0}, ", prime);
            }
        }
Esempio n. 2
0
        private static void GeneratingSynchronously()
        {
            Console.WriteLine();
            Demo.DisplayHeader("Using synchronous enumerable");

            var generator = new MagicalPrimeGenerator();

            // this will block the main thread for a few seconds
            foreach (var prime in generator.Generate(5))
            {
                Console.Write("{0}, ", prime);
            }
        }