FrmMethod.cs 749 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Diagnostics;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace FWindSoft.WinForm
  9. {
  10. /// <summary>
  11. /// Frm相关的静态方法
  12. /// </summary>
  13. public static class FrmMethod
  14. {
  15. public static bool IsDesignMode()
  16. {
  17. bool flag = false;
  18. #if DEBUG
  19. if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
  20. {
  21. flag = true;
  22. }
  23. else if (Process.GetCurrentProcess().ProcessName.Equals("devenv"))
  24. {
  25. flag = true;
  26. }
  27. #endif
  28. return flag;
  29. }
  30. }
  31. }