public void AddPassword(PasswordEntry password) { if (GetPasswordEntry(password.Title) != null) { throw new Exception("Toks slaptažodis jau egzistuoja"); } passwords.Add(password); }
public void RemovePassword(string title) { PasswordEntry pe = GetPasswordEntry(title); if (pe == null) { throw new Exception("Toks slapatažodis neegzistuoja"); } passwords.Remove(pe); }
public void UpdatePassword(string title, PasswordEntry passwordEntry) { int index = passwords.FindIndex(x => x.Title == title); if (index == -1) { throw new Exception("Nepavyko rasti šio slaptažodžio"); } passwords[index] = passwordEntry; }