Ejemplo n.º 1
0
        private void DoChangeLanguage(int langID)
        {
            try
            {
                LangTypeInfo langType =
                    CurrentApp.Session.SupportLangTypes.FirstOrDefault(l => l.LangID == langID);
                if (langType == null)
                {
                    return;
                }
                LangTypeInfo = langType;
                CurrentApp.Session.LangTypeInfo = langType;
                CurrentApp.Session.LangTypeID   = langType.LangID;
                SetBusy(true, string.Empty);
                BackgroundWorker worker = new BackgroundWorker();
                worker.DoWork             += (s, de) => CurrentApp.InitAllLanguageInfos();
                worker.RunWorkerCompleted += (s, re) =>
                {
                    worker.Dispose();
                    SetBusy(false, string.Empty);

                    ChangeLanguage();
                };
                worker.RunWorkerAsync();
            }
            catch (Exception ex)
            {
                ShowException(ex.Message);
            }
        }