Opc.Ua.Com.Server.ComProxy.SetLocaleId C# (CSharp) Method

SetLocaleId() public method

Sets the current locale.
public SetLocaleId ( int localeId ) : void
localeId int
return void
        public void SetLocaleId(int localeId)
        {
            ThrowIfNotConnected();

            try
            {
                StringCollection preferredLocales = new StringCollection();

                if (localeId != 0 && localeId != ComUtils.LOCALE_SYSTEM_DEFAULT)
                {
                    CultureInfo culture = CultureInfo.GetCultureInfo(localeId);

                    if (culture != null)
                    {
                        preferredLocales.Add(culture.Name);
                    }
                }

                m_session.ChangePreferredLocales(preferredLocales);
            }
            catch (Exception)
            {
                throw ComUtils.CreateComException(ResultIds.E_INVALIDARG);
            }
        }