This repository has been archived on 2025-09-26. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Password-Manager-Legacy/Password Manager/NewProfileForm.cs

51 lines
1.4 KiB
C#
Raw Normal View History

2023-03-24 13:01:49 +01:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Password_Manager
{
public partial class NewProfileForm : Form
{
public NewProfileForm()
{
InitializeComponent();
}
private void ChooseFolder(object sender, EventArgs e)
2023-03-24 14:03:09 +01:00
{
2023-03-24 13:01:49 +01:00
FolderBrowserDialog dialog = new FolderBrowserDialog();
if (dialog.ShowDialog() == DialogResult.OK)
{
pathTextBox.Text = dialog.SelectedPath;
}
}
2023-03-24 14:03:09 +01:00
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();
}
2023-03-24 13:01:49 +01:00
}
}