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 UInt32 Loops, Action_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);
            }
        }
        /// <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 UInt32 Loops, Action_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);
        }