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); } }
private void Initialize() { try { //1.0.160811.0800 新增使用者權限不得高於當前使用者 foreach (string accountLevelName in Enum.GetNames(typeof(AccountLevel))) { AccountLevel accountLevel = (AccountLevel)Enum.Parse(typeof(AccountLevel), accountLevelName); if ((AccountInfoManager.ActiveAccountLevel) >= accountLevel && (accountLevel != AccountLevel.Developer)) { this.cboAccountLevel.Items.Add(accountLevelName); } } _accountInfoCollection = AccountInfoManager.GetAccountInfoCollection(); RefreshData(); } catch (Exception ex) { MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); } }