Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AppDomain.CurrentDomain.UnhandledException += (sender, eventArgs) => {
- Log((Exception)eventArgs.ExceptionObject);
- Environment.Exit(1);
- };
- try
- {
- JsonConvert.DefaultSettings = () => new JsonSerializerSettings {
- TypeNameHandling = TypeNameHandling.Auto,
- NullValueHandling = NullValueHandling.Include,
- DefaultValueHandling = DefaultValueHandling.Include,
- Formatting = Formatting.None,
- ContractResolver = new CamelCasePropertyNamesContractResolver()
- };
- Directory.CreateDirectory("config/");
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- ECS ecs = new ECS();
- ecs.Load();
- bool instantRun = args.Length > 1 && args[1].ToLower() == "run";
- ecs.MainForm = new MainForm(ecs,
- args.Length > 0 ? args[0] : null, //first cmd line arg is path to procedure
- instantRun); //second cmd line arg is instant run
- Application.Run(ecs.MainForm);
- return 0;
- }
- catch(Exception ex)
- {
- Log(ex);
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement