04-27-2015 03:01 AM
I need to get a list of installed languages from CUPI. No problem - InstalledLanguage myLang = new InstalledLanguage();
But.. if we take UserBase as an example, there's a UserBase.GetUser that takes a connectionserverrest and returns a UserBase as out variables.
So I propose the following change to InstalledLanguages: Add a new static method that extracts the installed languages the same way other objects allow extraction and return a WebCallResult:
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;
}
That way, you can use the same mechanism to extract installed languages as other things.
Would you consider adding this to InstalledLanguages?
Thanks
Stephan
Message was edited by: Stephan Steiner, added a sample implementation of what I'm looking for
05-06-2015 10:15 AM
Stephan, I will submit this up as a feature enhancement and will post the bug ID here when I have completed it.
05-13-2015 01:04 PM
Actually, it's a feature request for Jeff's CUPI.NET lib. I hope he's on a well deserved holiday and I didn't scare him off with my ever outrageous requests.
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