private void btn_selectWgb_Click(object sender, EventArgs e) { var result = openFile_wgb.ShowDialog(); if (result == DialogResult.OK) { _filePath = openFile_wgb.FileName; HideError(); try { _configAndGestures = MigrateService.Import(_filePath); } catch (MigrateException ex) { ShowError(ex.Message); return; } var containsGestures = _configAndGestures.GestureIntentStore != null; var containsConfig = _configAndGestures.Config != null; check_importGestures.Checked = containsGestures; check_importGestures.Enabled = containsGestures; check_importConfig.Checked = containsConfig; check_importConfig.Enabled = containsConfig; txt_filePath.Text = _filePath; group_importOptions.Visible = true; } }
public SwiperMigrator(IProjectService projectService, IChallengeService challengeService, MigrateService migrateService, UserService userService, ILogger <SwiperMigrator> logger, IOptions <StorageConfig> storageConfig, IOptions <MigrationConfig> migrationConfig) { this.projectService = projectService; this.challengeService = challengeService; this.migrateService = migrateService; this.userService = userService; this.storageConfig = storageConfig.Value; this.migrationConfig = migrationConfig.Value; _logger = logger; }
private static void ImportPrevousVersion() { try { //导入先前版本 var prevConfigAndGestures = MigrateService.ImportPrevousVersion(); if (prevConfigAndGestures == null) { return; } intentStore.Import(prevConfigAndGestures.GestureIntentStore); config.Import(prevConfigAndGestures.Config); intentStore.Save(); } catch (MigrateException e) { //ignore #if DEBUG throw; #endif } }
internal void RestoreDefaultGestures() { _intentStore.Import(MigrateService.Import(AppSettings.DefaultGesturesFilePath).GestureIntentStore, replace: true); OnPropertyChanged("IntentStore"); }
internal void ExportTo(string filePath) { MigrateService.ExportTo(filePath); }