IdlingCommand.cs 963 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using Autodesk.Revit.UI;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace FWindSoft.Revit
  8. {
  9. /// <summary>
  10. /// 空闲命令
  11. /// </summary>
  12. public class IdlingCommand
  13. {
  14. #region 构造函数
  15. public IdlingCommand(RevitHandler handler)
  16. {
  17. this.Handler = handler;
  18. }
  19. #endregion
  20. #region 实例相关方法
  21. /// <summary>
  22. /// 命令实际处理者
  23. /// </summary>
  24. public RevitHandler Handler { get; private set; }
  25. /// <summary>
  26. /// 触发命令【raise把命令发给接受者】
  27. /// </summary>
  28. /// <returns></returns>
  29. public void Raise(UIApplication uiApplication)
  30. {
  31. if (Handler == null)
  32. {
  33. return;
  34. }
  35. Handler.Execute(uiApplication);
  36. }
  37. #endregion
  38. }
  39. }