明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 和尚777

[【IFoxCAD】] 最少代码的侧边栏菜单

    [复制链接]
发表于 2025-6-26 12:06:57 | 显示全部楼层
谢谢分享,正好需要
回复 支持 反对

使用道具 举报

发表于 2025-7-18 18:39:12 | 显示全部楼层
本帖最后由 uvyx 于 2025-7-18 19:19 编辑

当前上下文中不存在名称“Acap” "ForEach"

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
回复 支持 反对

使用道具 举报

发表于 2025-7-18 23:55:50 | 显示全部楼层
uvyx 发表于 2025-7-18 18:39
当前上下文中不存在名称“Acap” "ForEach"

  1. //
  2. // 摘要:
  3. //     Enumerates for each in this collection.
  4. //
  5. // 参数:
  6. //   this:
  7. //     The @this to act on.
  8. //
  9. //   action:
  10. //     The action.
  11. //
  12. // 类型参数:
  13. //   T:
  14. //     Generic type parameter.
  15. //
  16. // 返回结果:
  17. //     An enumerator that allows foreach to be used to process for each in this collection.
  18. public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T> action)
  19. {
  20.      T[] array = @this.ToArray();
  21.      T[] array2 = array;
  22.      foreach (T obj in array2)
  23.      {
  24.          action(obj);
  25.      }

  26.      return array;
  27. }

  28. //
  29. // 摘要:
  30. //     Enumerates for each in this collection.
  31. //
  32. // 参数:
  33. //   this:
  34. //     The @this to act on.
  35. //
  36. //   action:
  37. //     The action.
  38. //
  39. // 类型参数:
  40. //   T:
  41. //     Generic type parameter.
  42. //
  43. // 返回结果:
  44. //     An enumerator that allows foreach to be used to process for each in this collection.
  45. public static IEnumerable<T> ForEach<T>(this IEnumerable<T> @this, Action<T, int> action)
  46. {
  47.      T[] array = @this.ToArray();
  48.      for (int i = 0; i < array.Length; i++)
  49.      {
  50.          action(array, i);
  51.      }

  52.      return array;
  53. }


global using Acap = Autodesk.AutoCAD.ApplicationServices.Application;

global using Acaop = Autodesk.AutoCAD.ApplicationServices.Core.Application;



回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-8-2 16:35 , Processed in 0.147688 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表