protected override void OnStartup(StartupEventArgs e) { Log.Information($"Starting application for session {session.Id}"); if (!database.CanBeLoaded()) { MessageBox.Show("Missing some database files, please execute KBot.CLI.exe"); return; } if (!languageService.CanBeLoaded(SelectedLanguage)) { MessageBox.Show("Missing some translation files, please execute KBot.CLI.exe"); return; } Log.Debug($"Loading language service with language {SelectedLanguage}"); languageService.Load(SelectedLanguage); Log.Debug("Loading game database"); database.Load(); session.PacketReceived += packet => { IPacket typedPacket = packetFactory.CreateTypedPacket(packet.Trim(), PacketType.Received); if (typedPacket == null) { return; } networkManager.Process(session, typedPacket); }; session.PacketSend += packet => { IPacket typedPacket = packetFactory.CreateTypedPacket(packet.Trim(), PacketType.Send); if (typedPacket == null) { return; } networkManager.Process(session, typedPacket); }; var window = new MainWindow { DataContext = new MainWindowContext(contexts) }; Log.Debug("Showing main window"); window.Show(); }