Core - Ensure application data folder exists

UI - Properly catch exceptions during exception display
UI - Display fatal exceptions during Core creation, even before Core initialisation
This commit is contained in:
Robert committed 2020-03-12 19:34:53 +01:00
1 parent 0ccc1fed3d
commit d009b11e97
4 files changed
+45 -24

No files matched your search

+8 -1
View File
@@ -39,7 +39,14 @@ namespace Artemis.Core.Ninject
.Configure(c => c.When(HasAccessToProtectedService).InSingletonScope());
});
Kernel.Bind<LiteRepository>().ToMethod(t => new LiteRepository(Constants.ConnectionString)).InSingletonScope();
Kernel.Bind<LiteRepository>().ToMethod(t =>
{
// Ensure the data folder exists
if (!Directory.Exists(Constants.DataFolder))
Directory.CreateDirectory(Constants.DataFolder);
return new LiteRepository(Constants.ConnectionString);
}).InSingletonScope();
// Bind all repositories as singletons
Kernel.Bind(x =>
-2
View File
@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Artemis.Core.Events;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Models;
using Artemis.Core.RGB.NET;
using Artemis.Core.Services.Interfaces;