Bro i don't even know

This commit is contained in:
Miskolczi Richárd
2023-03-24 12:18:06 +01:00
parent 91c6f339ba
commit b4a83782e9
7 changed files with 49 additions and 35 deletions

Binary file not shown.

View File

@@ -31,44 +31,69 @@
searchBox = new TextBox();
resultList = new ListBox();
profileSelection = new ComboBox();
addProfile = new Button();
button2 = new Button();
SuspendLayout();
//
// textBox1
// searchBox
//
searchBox.Location = new Point(12, 27);
searchBox.Name = "textBox1";
searchBox.Name = "searchBox";
searchBox.PlaceholderText = "Search for a password";
searchBox.Size = new Size(257, 27);
searchBox.TabIndex = 0;
searchBox.TextChanged += UpdateResultList;
//
// listBox1
// resultList
//
resultList.FormattingEnabled = true;
resultList.ItemHeight = 20;
resultList.Location = new Point(12, 99);
resultList.Name = "listBox1";
resultList.Name = "resultList";
resultList.Size = new Size(150, 104);
resultList.TabIndex = 1;
//
// comboBox1
// profileSelection
//
profileSelection.DropDownHeight = 100;
profileSelection.DropDownWidth = 200;
profileSelection.FormattingEnabled = true;
profileSelection.Location = new Point(637, 26);
profileSelection.Name = "comboBox1";
profileSelection.Size = new Size(151, 28);
profileSelection.IntegralHeight = false;
profileSelection.Location = new Point(586, 26);
profileSelection.Name = "profileSelection";
profileSelection.Size = new Size(200, 28);
profileSelection.TabIndex = 2;
profileSelection.SelectedIndexChanged += ChangeProfile;
profileSelection.SelectedIndexChanged += ClearSearchBox;
//
// Form1
// button1
//
addProfile.Location = new Point(586, 60);
addProfile.Name = "button1";
addProfile.Size = new Size(95, 29);
addProfile.TabIndex = 3;
addProfile.Text = "Add";
addProfile.UseVisualStyleBackColor = true;
//
// button2
//
button2.Location = new Point(691, 60);
button2.Name = "button2";
button2.Size = new Size(95, 29);
button2.TabIndex = 4;
button2.Text = "Delete";
button2.UseVisualStyleBackColor = true;
//
// MainForm
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
Controls.Add(button2);
Controls.Add(addProfile);
Controls.Add(profileSelection);
Controls.Add(resultList);
Controls.Add(searchBox);
Name = "Form1";
Name = "MainForm";
Text = "Form1";
ResumeLayout(false);
PerformLayout();
@@ -79,5 +104,7 @@
public TextBox searchBox;
public ListBox resultList;
public ComboBox profileSelection;
private Button addProfile;
private Button button2;
}
}

View File

@@ -11,13 +11,16 @@ namespace Password_Manager
{
ComboBox cb = (ComboBox)sender;
Fields.CurrentProfile = Fields.ListOfProfiles.SearchByName(cb.Text);
}
private void ClearSearchBox(object sender, EventArgs e) //needed because declaring an anonymous method and subscribing that onto the delegate didn't work for some reason
{
searchBox.Clear();
}
private void UpdateResultList(object sender, EventArgs args)
{
//TODO:
//TODO
}
}
}

View File

@@ -1,14 +0,0 @@
using System;
namespace Password_Manager
{
sealed class PasswordListBox : ListBox
{
public PasswordListBox() : base() { }
public void ReadFromPath()
{
//read all files from
}
}
}

View File

@@ -8,7 +8,6 @@ namespace Password_Manager
{
public string Name { get; } //the name of the password store profile ("personal", "work", or similar)
public string Path { get; } //path of the folder containing the password store
private Password[] Passwords;
public event PasswordStoreChange Change; //runs if a new password is added, or if one is removed
public Profile(string name, string path, PasswordStoreChange change)

View File

@@ -4,7 +4,6 @@ namespace Password_Manager
{
sealed class ProfileList : IList<Profile>
{
public ProfileList() : base() { }
public override void Add(Profile p)