11-16-2016 01:21 AM
Hi
I've had to extract installed languages from a CUCN server.. and found that the InstalledLanguage object did not have a method to get all languages. So I've added this which extracts all languages using the same style as other object extractions. Any chance this could be added to the standard lib?
Thanks
public static WebCallResult GetInstalledLanguages(out List<InstalledLanguage> languages, ConnectionServerRest pConnectionServer)
{
WebCallResult res = new WebCallResult();
res.Success = false;
languages = null;
if (pConnectionServer == null)
{
res.ErrorText = "Null Connection server object passed to GetInstalledLanguages";
return res;
}
InstalledLanguage lang = null;
try
{
lang = new InstalledLanguage(pConnectionServer);
languages = lang.InstalledLanguages;
res.Success = true;
}
catch (UnityConnectionRestException ex)
{
return ex.WebCallResult;
}
catch (Exception ex)
{
res.ErrorText = "Failed to fetch languages in GetInstalledLanguages:" + ex.Message;
return res;
}
return res;
}
11-16-2016 06:31 AM
sure, I can add this - several projects in the works right now for a couple teams but this is pretty light, I should be able to fit this in this week.
11-17-2016 06:56 AM
actually, there is InstalledLanguages list as a public property off the InstalledLanguage class - when the class is built that list is populated out with all the languages found on the target server. This is what's used for checking if a specific language is installed or not on that server for instance.
11-17-2016 07:17 AM
I noticed. However, since my code is redundant, the redundancy bit requires WebResult to return to determine whether to try sending the command to the secondary server. All objects I'm using so far other than InstalledLanguages have a way to extract that returns a WebResult so my redundancy code was built on that.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide