I'm literally on fire rn

This commit is contained in:
Miskolczi Richárd
2023-03-24 14:03:09 +01:00
parent b06568fb27
commit 99498ed660
10 changed files with 85 additions and 51 deletions

View File

@@ -18,12 +18,33 @@ namespace Password_Manager
}
private void ChooseFolder(object sender, EventArgs e)
{
{
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
pathTextBox.Text = dialog.SelectedPath;
}
}
private void Save(object sender, EventArgs e)
{
if (nameTextBox.Text != "" && pathTextBox.Text != "")
{
Profile profile = new Profile(nameTextBox.Text, pathTextBox.Text);
ProfileHandler.ListOfProfiles.Add(profile);
ProfileHandler.CurrentProfile = profile;
Program.mainForm.resultList.ReloadResults();
this.Close();
}
else
{
MessageBox.Show("You must fill in all fields to continue.", "Error: Empty fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void Cancel(object sender, EventArgs e)
{
this.Close();
}
}
}