 - //
- // 摘要:
- // Enumerates for each in this collection.
- //
- // 参数:
- // this:
- // The @this to act on.
- //
- // action:
- // The action.
- //
- // 类型参数:
- // T:
- // Generic type parameter.
- //
- // 返回结果:
- // An enumerator that allows foreach to be used to process for each in this collection.
- public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T> action)
- {
- T[] array = @this.ToArray();
- T[] array2 = array;
- foreach (T obj in array2)
- {
- action(obj);
- }
- return array;
- }
- //
- // 摘要:
- // Enumerates for each in this collection.
- //
- // 参数:
- // this:
- // The @this to act on.
- //
- // action:
- // The action.
- //
- // 类型参数:
- // T:
- // Generic type parameter.
- //
- // 返回结果:
- // An enumerator that allows foreach to be used to process for each in this collection.
- public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T, int> action)
- {
- T[] array = @this.ToArray();
- for (int i = 0; i < array.Length; i++)
- {
- action(array, i);
- }
- return array;
- }
global using Acap = Autodesk.AutoCAD.ApplicationServices.Application;
global using Acaop = Autodesk.AutoCAD.ApplicationServices.Core.Application;
|