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

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

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