Beispiel #1
0
        private void RefreshPasswords()
        {
            ListView.Items.Clear();

            var allPasswords = _passwordRepository.GetByProfileId(_profile.Id);

            foreach (var password in allPasswords)
            {
                var passwordDto = password.GetPasswordDto(_password);
                ListView.Items.Add(new { password.Id, passwordDto.Name });
            }

            if (ListView.Items.Count > 0)
            {
                var id = (Guid)(ListView.Items[0] as dynamic).Id;

                var password    = _passwordRepository.GetById(id);
                var passwordDto = password.GetPasswordDto(_password);

                DescriptionTextBox.Text = passwordDto.Description;
                EmailTextBox.Text       = passwordDto.Email;
                _currentPassword        = passwordDto.Password;
            }
        }