private void AddCredentialsForm_Shown(object sender, EventArgs e)
        {
            cbGroup.SelectedIndex = -1;

            if (credentials == null)
            {
                Text        = Lng.Elem("Add credentials");
                btnAdd.Text = Lng.Elem("Add");

                tbName.Text              = String.Empty;
                tbAlternativeLink.Text   = String.Empty;
                tbLink.Text              = String.Empty;
                tbUsername.Text          = String.Empty;
                tbPassword.Text          = String.Empty;
                rtbExtraInformation.Text = String.Empty;
            }
            else
            {
                Text        = Lng.Elem("Modify credentials");
                btnAdd.Text = Lng.Elem("Modify");

                tbName.Text              = credentials.Name;
                cbGroup.Text             = credentials.Group;
                tbAlternativeLink.Text   = credentials.AlternativeLink;
                tbLink.Text              = credentials.Link;
                tbUsername.Text          = credentials.Username;
                tbPassword.Text          = credentials.Password;
                rtbExtraInformation.Text = credentials.ExtraInformation;
            }
            passwordManagerGroupsProvider.GetGroups(cbGroup);
        }
示例#2
0
        private void GetPasswords(bool getGroups)
        {
            if (getGroups)
            {
                passwordManagerGroupsProvider.GetGroups(cbGroup);
            }

            var group = cbGroup.SelectedIndex == 0 ? String.Empty : (string)cbGroup.SelectedItem;

            credentialsProvider.GetCredentials(lvCredentials, tb_Search.Text, group);
        }