public static void PerformOn(Configuration.Settings settings) { if (settings.Version < 1) { UpdateTo1(settings); } }
void StartEmulator(string romPath) { if (emulatorRunning) { return; } if (!File.Exists(romPath) || !romPath.EndsWith(".gbc")) { return; } emulatorRunning = true; Configuration.Settings settings = Program.settings; sdl2Manager = new SDL2Manager(settings); //Application.Invoke allows methods to be called on the main GUI thread. sdl2Manager.OnEmulatorStarted += (o, e) => Application.Invoke(OnEmulatorStart); sdl2Manager.OnEmulatorPaused += (o, e) => Application.Invoke(OnEmulatorPause); sdl2Manager.OnEmulatorResumed += (o, e) => Application.Invoke(OnEmulatorResume); sdl2Manager.OnEmulatorStop += (o, e) => Application.Invoke(OnEmulatorStop); sdl2Manager.Start(romPath); }
public void TestSourceRepoPackageSourcesChanged2() { // Arrange using (var settingsPath = TestPackageSourceSettings.CreateAndGetSettingFilePath()) { var settings = new Configuration.Settings(settingsPath); var packageSourceProvider = new Configuration.PackageSourceProvider(settings); var sourceRepositoryProvider = TestSourceRepositoryUtility.CreateSourceRepositoryProvider(packageSourceProvider); // Act var oldEffectivePackageSources = sourceRepositoryProvider.GetRepositories().ToList(); // Assert Assert.Equal(1, oldEffectivePackageSources.Count); Assert.Equal(TestSourceRepositoryUtility.V2PackageSource.Source, oldEffectivePackageSources[0].PackageSource.Source); // Main Act var newPackageSources = new List <Configuration.PackageSource> { TestSourceRepositoryUtility.V3PackageSource, TestSourceRepositoryUtility.V2PackageSource }; packageSourceProvider.SavePackageSources(newPackageSources); var newEffectivePackageSources = sourceRepositoryProvider.GetRepositories().ToList(); // Main Assert Assert.Equal(2, newEffectivePackageSources.Count); Assert.Equal(TestSourceRepositoryUtility.V3PackageSource.Source, newEffectivePackageSources[0].PackageSource.Source); Assert.Equal(TestSourceRepositoryUtility.V2PackageSource.Source, newEffectivePackageSources[1].PackageSource.Source); } }
public static Configuration.Settings MigrateOldConfig() { if (!File.Exists(PATH_V1_SETTINGS)) { return(null); } try { Settings oldSettings = SerializationHelper.LoadObjectFromFile <Settings>(PATH_V1_SETTINGS); Configuration.Settings settings = new Configuration.Settings { UpdateRate = oldSettings.UpdateRate }; settings[VisualizationIndex.Primary].SelectedVisualization = VisualizationType.FrequencyBars; settings[VisualizationIndex.Primary].FrequencyBarsConfiguration = oldSettings.FrequencyBarsVisualizationProviderConfiguration; settings[VisualizationIndex.Primary].EqualizerConfiguration = oldSettings.EqualizerConfiguration; settings[VisualizationIndex.Secondary].SelectedVisualization = VisualizationType.Beat; settings[VisualizationIndex.Secondary].BeatConfiguration = oldSettings.BeatVisualizationProviderConfiguration; settings[VisualizationIndex.Tertiary].SelectedVisualization = VisualizationType.Level; settings[VisualizationIndex.Tertiary].LevelConfiguration = oldSettings.LevelVisualizationProviderConfiguration; return(settings); } catch { return(null); } }
public void LoadSettings(Configuration.Settings settings) { for (int i = 0; i < keys.Length; i++) { for (int j = 0; j < settings.KeyBinds.Length; j++) { if (keys[i].gbKey != settings.KeyBinds[j].gameBoyKey) { continue; } keys[i].key = (SDL.SDL_Keycode)(settings.KeyBinds[j].sdlKey); } } }
private static void UpdateTo1(Configuration.Settings settings) { settings.Visualizations[VisualizationIndex.Primary].Gradient = new LinearGradient(new GradientStop(0, HSVColor.Create(300, 1, 1)), new GradientStop(0.20, HSVColor.Create(225, 1, 1)), new GradientStop(0.35, HSVColor.Create(180, 1, 1)), new GradientStop(0.50, HSVColor.Create(135, 1, 1)), new GradientStop(0.65, HSVColor.Create(90, 1, 1)), new GradientStop(0.80, HSVColor.Create(45, 1, 1)), new GradientStop(0.95, HSVColor.Create(0, 1, 1))); settings.Visualizations[VisualizationIndex.Secondary].Gradient = new LinearGradient(new GradientStop(0.5, new Color(255, 255, 255))); settings.Visualizations[VisualizationIndex.Tertiary].Gradient = new LinearGradient(new GradientStop(0, new Color(0, 0, 255)), new GradientStop(1, new Color(255, 0, 0))); settings.Version = 1; }
public void SetSettings(Configuration.Settings emulatorSettings) { //Used for runtime settings settings = emulatorSettings; if (emulatedGameBoy == null) { return; } bool alreadyPaused = IsPaused; emulatedGameBoy.Pause(); emulatedGameBoy.EnableFramerateLimiter = settings.LimitSpeed; keyStateManager.LoadSettings(settings); if (!alreadyPaused) { emulatedGameBoy.Run(); } }
public async Task BuildIntegratedRestoreUtility_RestoreToRelativePathGlobalPackagesFolder() { // Arrange var projectName = "testproj"; using (var rootFolder = TestDirectory.Create()) using (var configFolder = TestDirectory.Create()) using (var solutionFolderParent = TestDirectory.Create()) { var projectFolder = new DirectoryInfo(Path.Combine(rootFolder, projectName)); projectFolder.Create(); var projectConfig = new FileInfo(Path.Combine(projectFolder.FullName, "project.json")); var msbuildProjectPath = new FileInfo(Path.Combine(projectFolder.FullName, $"{projectName}.csproj")); File.WriteAllText(projectConfig.FullName, BuildIntegrationTestUtility.ProjectJsonWithPackage); var sources = new List <SourceRepository> { Repository.Factory.GetVisualStudio("https://www.nuget.org/api/v2/") }; var projectTargetFramework = NuGetFramework.Parse("uap10.0"); var msBuildNuGetProjectSystem = new TestMSBuildNuGetProjectSystem(projectTargetFramework, new TestNuGetProjectContext()); var project = new ProjectJsonNuGetProject(projectConfig.FullName, msbuildProjectPath.FullName); var configContents = @"<?xml version=""1.0"" encoding=""utf-8""?> <configuration> <config> <add key=""globalPackagesFolder"" value=""..\NuGetPackages"" /> </config> <packageSources> <add key=""nuget.org.v2"" value=""https://www.nuget.org/api/v2/"" /> </packageSources> </configuration>"; var configSubFolder = Path.Combine(configFolder, "sub"); Directory.CreateDirectory(configSubFolder); File.WriteAllText(Path.Combine(configFolder, "sub", "nuget.config"), configContents); var settings = new Configuration.Settings(configSubFolder); // TODO NK - Fix this test var solutionFolder = new DirectoryInfo(Path.Combine(solutionFolderParent, "solutionFolder")); solutionFolder.Create(); var solutionManager = new TestSolutionManager(false); solutionManager.NuGetProjects.Add(project); var testLogger = new TestLogger(); var restoreContext = new DependencyGraphCacheContext(testLogger, settings); // Act await DependencyGraphRestoreUtility.RestoreAsync( solutionManager, restoreContext, new RestoreCommandProvidersCache(), (c) => { }, sources, false, await DependencyGraphRestoreUtility.GetSolutionRestoreSpec(solutionManager, restoreContext), testLogger, CancellationToken.None); // Assert Assert.True(File.Exists(Path.Combine(projectFolder.FullName, "project.lock.json"))); var packagesFolder = Path.Combine(configFolder, "NuGetPackages"); Assert.True(Directory.Exists(packagesFolder)); Assert.True(File.Exists(Path.Combine( packagesFolder, "EntityFramework", "5.0.0", "EntityFramework.5.0.0.nupkg"))); Assert.True(testLogger.Errors == 0, testLogger.ShowErrors()); } }
public SqlServerEventStoreSingleTableFixture() { this.EventDispatcher = new Mock <IEventDispatcher>().Object; this.Settings = new Configuration.Settings(Config.SingleTableConnectionString, useSingleTable: true); }
public SqlServerEventStoreCompressionFixture() { this.EventDispatcher = new Mock <IEventDispatcher>().Object; this.Settings = new Configuration.Settings(Config.CompressionConnectionString, useCompression: true); }
public SDL2Manager(Configuration.Settings emuSettings) { settings = emuSettings; }