public void GetDBContainers(TranslationProviderServer tmServer) { string dbInfo = string.Empty; foreach (TranslationMemoryContainer container in tmServer.GetContainers(ContainerProperties.None)) { dbInfo += "DB Name: " + container.DatabaseName + "\n"; dbInfo += "Friendly name: " + container.Name + "\n"; dbInfo += "DB Server: " + container.DatabaseServer + "\n"; dbInfo += "Description: " + container.Description + "\n\n"; dbInfo += "ParentOrganization: " + container.ParentResourceGroupPath + "\n\n"; } MessageBox.Show(dbInfo); }
public void Execute() { var uri = new Uri(@"Add your url"); var translationProviderServer = new TranslationProviderServer(uri, false, "user name", "password"); var serverTm = new ServerBasedTranslationMemory(translationProviderServer) { Name = "Tm from API" }; var resourceTemplate = translationProviderServer.GetLanguageResourcesTemplates(LanguageResourcesTemplateProperties.All); var containters = translationProviderServer.GetContainers(ContainerProperties.All); var container = containters.FirstOrDefault(c => c.Name.Equals("APSIC_TM_Container")); if (container != null) { serverTm.Container = container; serverTm.ParentResourceGroupPath = container.ParentResourceGroupPath; serverTm.LanguageResourcesTemplate = resourceTemplate?[0]; CreateLanguageDirections(serverTm.LanguageDirections); serverTm.Save(); } }