Пример #1
0
        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);
            }
        }
Пример #2
0
 public UserProcess(DatabaseContext context)
 {
     context.Database.EnsureCreated();
     _context = context;
     _daUsers = InjectionManager.GetInstance <IDA_Users>();
 }