| Retrieving Licensing Information |
An SDL TM Server is licensed for a certain number of concurrent users and the number of translation units that it can store at maximum. It may sometimes be necessary to retrieve the maximum number of TUs allowed, and the number of TUs currently stored. This chapter provides an example of how to retrieve this information programmatically.
Start by adding a class called ServerLicensing to your project. Then implement a public function called GetLicensingInformation, which takes a TranslationProviderServer object as parameter. This function can be called as shown below:
ServerLicensing license = new ServerLicensing();
license.GetLicensingInformation(tmServer);public void GetLicensingInformation(TranslationProviderServer tmServer) { string licInfo = string.Empty; LicensingStatusInformation info; info = tmServer.GetLicensingStatusInformation(); licInfo += "Max. concurrent users: " + info.MaxConcurrentUsers.ToString(); licInfo += "Max. TU count: " + info.MaxTranslationUnitCount.ToString(); licInfo += "Current TU count: " + info.CurrentTranslationUnitCount.ToString(); MessageBox.Show(licInfo, "Licensing Information"); }
Below you see an example of the licensing information as displayed in the SDL TM Server Manager:

The complete class looks as shown below:
namespace Sdl.SDK.LanguagePlatform.Samples.TmAutomation { using System.Windows.Forms; using Sdl.LanguagePlatform.TranslationMemoryApi; public class ServerLicensing { #region "get" public void GetLicensingInformation(TranslationProviderServer tmServer) { string licInfo = string.Empty; LicensingStatusInformation info; info = tmServer.GetLicensingStatusInformation(); licInfo += "Max. concurrent users: " + info.MaxConcurrentUsers.ToString(); licInfo += "Max. TU count: " + info.MaxTranslationUnitCount.ToString(); licInfo += "Current TU count: " + info.CurrentTranslationUnitCount.ToString(); MessageBox.Show(licInfo, "Licensing Information"); } #endregion } }