App.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using LRH;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Configuration;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Threading;
  10. namespace LRH
  11. {
  12. /// <summary>
  13. /// App.xaml 的交互逻辑
  14. /// </summary>
  15. public partial class App : Application
  16. {
  17. protected override void OnStartup(StartupEventArgs e)
  18. {
  19. //1、将动图编译成splashScreen
  20. //2、将动图编译成资源进行如下代码操作
  21. SplashScreen s = new SplashScreen("Screen.gif");
  22. s.Show(true);
  23. var items = RevitManager.GetRevitItems();
  24. //DispatcherPriority.Loaded优先级,在窗体加载完成时才进行执行。通过优先级去控制顺序
  25. //Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Loaded, new DispatcherOperationCallback(ex=>MessageBox.Show(ex.ToString())), this);
  26. base.OnStartup(e);
  27. }
  28. //[STAThread]
  29. //public static void Main()
  30. //{//此方法和app.xaml冲突
  31. // App app = new App();
  32. // app.Run();
  33. //}
  34. }
  35. }