protected override void OnSourceInitialized(EventArgs e) { InstallMod.IsChecked = _trainingRoom.IsModInstalled(); _memory.Load(); var timer = new DispatcherTimer(); timer.Tick += OnTimerTick; timer.Interval = new TimeSpan(5000000); timer.Start(); }
public MainWindow() { _memory = new Memory(); _challenge = new Challenge(_memory); _trainingRoom = new TrainingRoom(); _updateDelay = new Stopwatch(); _memory.OnProcessOpened = process => { var filename = process.MainModule?.FileName; var location = filename?.Substring(0, filename.LastIndexOf('\\')); _trainingRoom.SetGameLocation(location); InstallMod.IsChecked = _trainingRoom.IsModInstalled(); }; InitializeComponent(); UpdateFields(); }