Exemple #1
0
        /// <summary>
        /// Loop for the given number of iterations while calling
        /// the given delegate with the current iteration as parameter.
        /// </summary>
        /// <param name="Loops">The number of iterations.</param>
        /// <param name="Do">A delegate to call.</param>
        public static void Loop(this UInt64 Loops, Action_UInt64 Do)
        {
            if (Do == null)
            {
                throw new ArgumentNullException("Do", "The parameter 'Do' must not be null!");
            }

            for (var i = 0UL; i < Loops; i++)
            {
                Do(i);
            }
        }
        /// <summary>
        /// Loop for the given number of iterations while calling
        /// the given delegate with the current iteration as parameter.
        /// </summary>
        /// <param name="Loops">The number of iterations.</param>
        /// <param name="Do">A delegate to call.</param>
        public static void Loop(this UInt64 Loops, Action_UInt64 Do)
        {
            if (Do == null)
                throw new ArgumentNullException("Do", "The parameter 'Do' must not be null!");

            for (var i = 0UL; i < Loops; i++)
                Do(i);
        }