comparison MetroWpf/MetroWpf.Framework/Extensions/IntExtensions.cs @ 15:060f02cd4591

Initial commit, pre airport work
author stevenh7776 stevenhollidge@hotmail.com
date Mon, 12 Mar 2012 23:05:21 +0800
parents
children
comparison
equal deleted inserted replaced
14:741981715d94 15:060f02cd4591
1 using System;
2
3 namespace MetroWpf
4 {
5 /// <summary>
6 /// Extension methods for the string data type
7 /// </summary>
8 public static class IntExtensions
9 {
10 #region · Extensions ·
11
12 /// <summary>
13 /// Performs the specified action n times based on the underlying int value.
14 /// </summary>
15 /// <param name="value">The value.</param>
16 /// <param name="action">The action.</param>
17 public static void Times(this int value, Action action)
18 {
19 for (var i = 0; i < value; i++)
20 {
21 action();
22 }
23 }
24
25 /// <summary>
26 /// Performs the specified action n times based on the underlying int value.
27 /// </summary>
28 /// <param name="value">The value.</param>
29 /// <param name="action">The action.</param>
30 public static void Times(this int value, Action<int> action)
31 {
32 for (var i = 0; i < value; i++)
33 {
34 action(i);
35 }
36 }
37
38 #endregion
39 }
40 }