Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. AppDomain.CurrentDomain.UnhandledException += (sender, eventArgs) => {
  2. Log((Exception)eventArgs.ExceptionObject);
  3. Environment.Exit(1);
  4. };
  5.  
  6. try
  7. {
  8. JsonConvert.DefaultSettings = () => new JsonSerializerSettings {
  9. TypeNameHandling = TypeNameHandling.Auto,
  10. NullValueHandling = NullValueHandling.Include,
  11. DefaultValueHandling = DefaultValueHandling.Include,
  12. Formatting = Formatting.None,
  13. ContractResolver = new CamelCasePropertyNamesContractResolver()
  14. };
  15.  
  16. Directory.CreateDirectory("config/");
  17. Application.EnableVisualStyles();
  18. Application.SetCompatibleTextRenderingDefault(false);
  19.  
  20. ECS ecs = new ECS();
  21. ecs.Load();
  22.  
  23. bool instantRun = args.Length > 1 && args[1].ToLower() == "run";
  24.  
  25. ecs.MainForm = new MainForm(ecs,
  26. args.Length > 0 ? args[0] : null, //first cmd line arg is path to procedure
  27. instantRun); //second cmd line arg is instant run
  28.  
  29.  
  30. Application.Run(ecs.MainForm);
  31. return 0;
  32. }
  33. catch(Exception ex)
  34. {
  35. Log(ex);
  36. return -1;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement