public void GetDBServers(TranslationProviderServer tmServer) { string serverInfo = string.Empty; foreach (DatabaseServer dbServer in tmServer.GetDatabaseServers(DatabaseServerProperties.None)) { serverInfo += "Server name: " + dbServer.ServerName + "\n"; serverInfo += "Friendly server name: " + dbServer.Name + "\n"; serverInfo += "Server description: " + dbServer.Description + "\n"; serverInfo += "Server type: " + dbServer.ServerType + "\n\n"; } MessageBox.Show(serverInfo, "Container Information"); }
public void CreateAdvanced(TranslationProviderServer tmServer, string organization, string newContainerName) { #region "count" ReadOnlyCollection <DatabaseServer> dbs = tmServer.GetDatabaseServers(DatabaseServerProperties.Containers); if (dbs.Count == 0) { throw new Exception("No DB server registered."); } #endregion #region "CheckExists" foreach (TranslationMemoryContainer item in dbs[0].Containers) { if (item.Name == newContainerName) { throw new Exception("Container with that name already exists."); } } #endregion #region "CreateContainer" TranslationMemoryContainer container = new TranslationMemoryContainer(tmServer); container.DatabaseServer = dbs[0]; container.DatabaseName = newContainerName + "DB"; container.Name = newContainerName; container.ParentResourceGroupPath = organization; container.Save(); #endregion #region "CheckCreated" if (!dbs[0].Containers.Contains(container)) { throw new Exception("Container was not created."); } #endregion }