public string GetTranslationMemoryPath(StudioVersion studioVersion) { var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); var folderName = string.Format("{0}.0.0.0", studioVersion.ExecutableVersion.Major); return(Path.Combine(appDataPath, string.Format("SDL\\SDL Trados Studio\\{0}\\TranslationMemoryRepository.xml", folderName))); }
public string GetTranslationMemoryPath(StudioVersion studioVersion) { var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); var folderName = $@"{studioVersion.ExecutableVersion.Major}.0.0.0"; return(Path.Combine(appDataPath, $@"SDL\SDL Trados Studio\{folderName}\TranslationMemoryRepository.xml")); }
public List <PluginPackageInfo> GetInstalledPlugins(StudioVersion studioVersion) { var installedPlugins = new List <PluginPackageInfo>(); var pluginPath = _pluginFolderLocations.Select( pluginFolderLocation => string.Format(pluginFolderLocation, studioVersion.ExecutableVersion.Major)); //check the folder exists before iterating on it. var ExistingPluginPath = new List <String>(); foreach (var plugin in pluginPath) { if (Directory.Exists(plugin)) { ExistingPluginPath.Add(plugin); } } { foreach (var plugin in ExistingPluginPath.Select(path => Directory.GetFiles(path, "*.sdlplugin")) .Where(plugin => plugin.Length != 0)) { installedPlugins.AddRange(GetPluginPackages(plugin)); } } return(installedPlugins); }
public StudioVersion GetStudioVersion() { var assembly = Assembly.LoadFile(string.Format(@"{0}\{1}", AppDomain.CurrentDomain.BaseDirectory.TrimEnd('\\'), "SDLTradosStudio.exe")); var versionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); var currentVersion = new Version(versionInfo.FileVersion); var installedStudioVersion = _installedStudioVersions.Find(x => x.ExecutableVersion.Major.Equals(currentVersion.Major)); var studioVersion = new StudioVersion { InstallPath = assembly.Location, Version = installedStudioVersion.Version, PublicVersion = installedStudioVersion.PublicVersion, ShortVersion = installedStudioVersion.ShortVersion, ExecutableVersion = currentVersion }; return(studioVersion); }
public List <string> GetInstalledPlugins(StudioVersion studioVersion) { var installedPlugins = new List <string>(); var pluginPath = _pluginFolderLocations.Select( pluginFolderLocation => string.Format(pluginFolderLocation, studioVersion.ExecutableVersion.Major)); foreach (var plugin in pluginPath.Select(path => Directory.GetFiles(path, "*.sdlplugin")) .Where(plugin => plugin.Length != 0)) { installedPlugins.AddRange(plugin); } return(installedPlugins); }
private List <Model.PluginInfo> GetInstallledPluginsForSpecificStudioVersion(StudioVersion studioVersion) { var pluginService = new PluginService(); var pluginsList = new List <Model.PluginInfo>(); foreach (var path in pluginService.GetInstalledPlugins(studioVersion)) { var plugin = new Model.PluginInfo { Path = path, PluginName = Path.GetFileNameWithoutExtension(path) }; pluginsList.Add(plugin); } return(pluginsList); }
private void projectMigrationWizzard_AfterSwitchPages(object sender, CristiPotlog.Controls.Wizard.AfterSwitchPagesEventArgs e) { // get wizard page to be displayed WizardPage newPage = projectMigrationWizzard.Pages[e.NewIndex]; var selectedSourceStudioVersionsGeneric = chkSourceStudioVersions.CheckedObjects; var sourceStudioVersion = new StudioVersion(); var destinationStudioVersion = new StudioVersion(); var skipPluginsPage = true; if (selectedSourceStudioVersionsGeneric.Count > 0) { sourceStudioVersion = (StudioVersion)selectedSourceStudioVersionsGeneric[0]; } var selectedDestinationStudioVersionsGeneric = chkDestinationStudioVersion.CheckedObjects; if (selectedDestinationStudioVersionsGeneric.Count > 0) { destinationStudioVersion = (StudioVersion)selectedDestinationStudioVersionsGeneric[0]; } if (destinationStudioVersion.Version != null && (sourceStudioVersion.Version != null && (sourceStudioVersion.Version.Equals("Studio4") && destinationStudioVersion.Version.Equals("Studio5")))) { skipPluginsPage = false; } if (newPage == taskRunnerPage) { StartTask(); } //this will skip the plugins page if selected versions are different from 2015-2017 if (newPage == pluginsPage && e.OldIndex == 3 && skipPluginsPage) { projectMigrationWizzard.Next(); } if (newPage == pluginsPage && e.OldIndex == 5 && skipPluginsPage) { projectMigrationWizzard.Back(); } }
private void InitializeListView(StudioVersion studioVersion) { _installedPlugins = _pluginManagementService.GetInstalledPlugins(studioVersion); installedPluginListView.SetObjects(_installedPlugins); }
public MigrateProjectsService(StudioVersion sourceVersion, StudioVersion destinationVersion) { _sourceStudioVersion = sourceVersion; _destinationStudioVersion = destinationVersion; }
public String GetProjectsPath(StudioVersion studioVersion) { var myDocumnetsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); return(Path.Combine(myDocumnetsPath, string.Format("{0}\\Projects\\projects.xml", studioVersion.PublicVersion))); }
public string GetProjectsPath(StudioVersion studioVersion) { var myDocumnetsPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); return(Path.Combine(myDocumnetsPath, $@"{studioVersion.StudioDocumentsFolderName}\Projects\projects.xml")); }