public InjectorViewModel(InjectorStateManager stateManager, FileManager fileManager, InjectionManager injector) { _logger = new Logger(Common.Paths.InjectorLogFileName); PatchCommand = new DelegateCommand(Patch, CanPatch); RestoreBackupCommand = new DelegateCommand(RestoreBackup, CanRestoreBackup); ExitCommand = new DelegateCommand(App.Current.Shutdown); _stateManager = stateManager; _fileManager = fileManager; _injector = injector; _injector.Logger = _logger; State = TryLoadLastAppState(); try { if (!IsCSharpPatched && CanRestoreCSharpBackup()) { Status = GetNotPatchedWithBackupMessage("Assembly-CSharp.dll"); } if (!IsFirstpassPatched && CanRestoreFirstpassBackup()) { Status = GetNotPatchedWithBackupMessage("Assembly-CSharp-firstpass.dll"); } } catch (Exception e) { _logger.Log("Error while trying to determine if assemblies are patched."); _logger.Log(e); } }
public UserProcess(DatabaseContext context) { context.Database.EnsureCreated(); _context = context; _daUsers = InjectionManager.GetInstance <IDA_Users>(); }