private void ChangeInstallation(GameInstallation installation) { _installation = installation; if (_fileSystem != null) { _fileSystem.Dispose(); _fileSystem = null; } if (_game != null) { _game.Dispose(); _game = null; } _fileSystem = installation.CreateFileSystem(); _game = new Game( HostPlatform.GraphicsDevice, HostPlatform.GraphicsDevice2D, _fileSystem, installation.Game); InstallationChanged?.Invoke(this, new InstallationChangedEventArgs(installation, _fileSystem)); }
private void ChangeInstallation(GameInstallation installation) { _installation = installation; if (_fileSystem != null) { _fileSystem.Dispose(); _fileSystem = null; } var launcherImagePath = installation.Game.LauncherImagePath; if (launcherImagePath != null) { var fullImagePath = Path.Combine(installation.Path, launcherImagePath); _installationImageView.Image = new Bitmap(fullImagePath); } else { _installationImageView.Image = null; } _fileSystem = installation.CreateFileSystem(); InstallationChanged?.Invoke(this, new InstallationChangedEventArgs(installation, _fileSystem)); }
/// <summary> /// Fires the <see cref="InstallationChanged"/> event. /// </summary> /// <param name="remoteService">The remote service.</param> private void OnInstallationChanged(ManagementBaseObject remoteService) { InstallationChanged?.Invoke(remoteService); }