Exemplo n.º 1
0
        private void Initialize()
        {
            try
            {
                _accountInfoCollection = AccountInfoManager.GetAccountInfoCollection();
                for (int i = 0; i < _accountInfoCollection.Count; i++)
                {
                    this.cboAccount.Items.Add(_accountInfoCollection[i].Name);
                }
                if (_accountInfoCollection.Count > 0)
                {
                    this.cboAccount.SelectedIndex = 0;
                }
                else
                {
                    this.cboAccount.Text = ResourceHelper.Language.GetString("NoUser");
                }

                LanguageManager.Apply(this);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace);
            }
        }
Exemplo n.º 2
0
        private void setLanguage(Language lang)
        {
            if (lang == Language.English)
            {
                this.cultureInfo = new CultureInfo("en");
                //更新表單
                LanguageManager.Apply(this, "en");
            }
            if (lang == Language.TraditionalChinese)
            {
                this.cultureInfo = new CultureInfo("zh-TW");
                //更新表單
                LanguageManager.Apply(this, "zh-TW");
            }

            // UI 的語系(MessageBox 屬於Form的UI)
            Thread.CurrentThread.CurrentUICulture = this.cultureInfo;
            // 非 UI 的語系(Exception 不屬於Form的UI),因為有些錯誤資訊是擷取Exception的data,所以exception的語系也要改掉。
            Thread.CurrentThread.CurrentCulture = this.cultureInfo;
        }
Exemplo n.º 3
0
        private void RecipeEditorControl_Load(object sender, EventArgs e)
        {
            if (ProcessInfo.IsDesignMode())
            {
                return;
            }
            _recipeInfoCollection   = new RecipeInfoCollection();
            this.SelectedRecipeInfo = new RecipeInfo();

            RecipeInfoManager.GetInstance().RecipeInfoSelectedIndexChanged += new RecipeInfoManager.RecipeInfoSelectedIndexChangedEventHandler(RecipeEditorControl_RecipeInfoSelectedIndexChangedEvent);
            RecipeInfoManager.GetInstance().RecipeInfoCollectionChanged    += new RecipeInfoManager.RecipeInfoCollectionChangedEventHandler(RecipeEditorControl_RecipeInfoCollectionChangedEvent);
            RecipeInfoManager.GetInstance().RecipeInfoCopyChanged          += new RecipeInfoManager.RecipeInfoCopyChangedEventHandler(RecipeEditorControl_RecipeInfoCopyChangedEvent);
            RefreshRecipeInfoCollection();

            RecipeInfo actRecipeInfo = RecipeInfoManager.GetInstance().ActiveRecipe;

            if (actRecipeInfo != null)
            {
                RefreshRecipeStatus(actRecipeInfo.RecipeNo.ToString("D3"), actRecipeInfo.RecipeID);
            }

            LanguageManager.Apply(this);
        }