bro check it out

This commit is contained in:
Miskolczi Richárd
2023-03-24 12:39:50 +01:00
parent b4a83782e9
commit bb7625d2f8
6 changed files with 36 additions and 19 deletions

Binary file not shown.

View File

@@ -29,10 +29,10 @@
private void InitializeComponent() private void InitializeComponent()
{ {
searchBox = new TextBox(); searchBox = new TextBox();
resultList = new ListBox(); resultList = new ResultListBox();
profileSelection = new ComboBox(); profileSelection = new ComboBox();
addProfile = new Button(); addProfile = new Button();
button2 = new Button(); removeProfile = new Button();
SuspendLayout(); SuspendLayout();
// //
// searchBox // searchBox
@@ -65,30 +65,32 @@
profileSelection.TabIndex = 2; profileSelection.TabIndex = 2;
profileSelection.SelectedIndexChanged += ClearSearchBox; profileSelection.SelectedIndexChanged += ClearSearchBox;
// //
// button1 // addProfile
// //
addProfile.Location = new Point(586, 60); addProfile.Location = new Point(586, 60);
addProfile.Name = "button1"; addProfile.Name = "addProfile";
addProfile.Size = new Size(95, 29); addProfile.Size = new Size(95, 29);
addProfile.TabIndex = 3; addProfile.TabIndex = 3;
addProfile.Text = "Add"; addProfile.Text = "Add";
addProfile.UseVisualStyleBackColor = true; addProfile.UseVisualStyleBackColor = true;
addProfile.Click += AddProfile;
// //
// button2 // button2
// //
button2.Location = new Point(691, 60); removeProfile.Location = new Point(691, 60);
button2.Name = "button2"; removeProfile.Name = "button2";
button2.Size = new Size(95, 29); removeProfile.Size = new Size(95, 29);
button2.TabIndex = 4; removeProfile.TabIndex = 4;
button2.Text = "Delete"; removeProfile.Text = "Delete";
button2.UseVisualStyleBackColor = true; removeProfile.UseVisualStyleBackColor = true;
// //
// MainForm // MainForm
// //
AutoScaleDimensions = new SizeF(8F, 20F); AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450); ClientSize = new Size(800, 450);
Controls.Add(button2); Controls.Add(removeProfile);
Controls.Add(addProfile); Controls.Add(addProfile);
Controls.Add(profileSelection); Controls.Add(profileSelection);
Controls.Add(resultList); Controls.Add(resultList);
@@ -102,9 +104,9 @@
#endregion #endregion
public TextBox searchBox; public TextBox searchBox;
public ListBox resultList; public ResultListBox resultList;
public ComboBox profileSelection; public ComboBox profileSelection;
private Button addProfile; private Button addProfile;
private Button button2; private Button removeProfile;
} }
} }

View File

@@ -20,7 +20,20 @@ namespace Password_Manager
private void UpdateResultList(object sender, EventArgs args) private void UpdateResultList(object sender, EventArgs args)
{ {
//TODO resultList.Refresh();
}
private void ProfileChange(object sender, EventArgs e)
{
searchBox.Clear();
resultList.Refresh();
}
private void AddProfile(object sender, EventArgs e)
{
Fields.ListOfProfiles.Add(new Profile("tmp", @"C:\Users\RichardMiskolczi\pass"));
Fields.CurrentProfile = Fields.ListOfProfiles[0]; //temporary
ProfileChange(sender, e);
} }
} }
} }

View File

@@ -4,5 +4,8 @@
<Compile Update="Form1.cs"> <Compile Update="Form1.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Update="ResultListBox.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -8,13 +8,13 @@ namespace Password_Manager
{ {
public string Name { get; } //the name of the password store profile ("personal", "work", or similar) 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 public string Path { get; } //path of the folder containing the password store
public event PasswordStoreChange Change; //runs if a new password is added, or if one is removed //public event PasswordStoreChange Change; //runs if a new password is added, or if one is removed
public Profile(string name, string path, PasswordStoreChange change) public Profile(string name, string path)
{ {
Name = name; Name = name;
Path = path; Path = path;
Change = change; //Change = change;
} }
} }
} }

View File

@@ -8,8 +8,7 @@ namespace Password_Manager
[STAThread] [STAThread]
static void Main() static void Main()
{ {
// To customize application configuration such as set high DPI settings or default font, Fields.ListOfProfiles = new ProfileList();
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize(); ApplicationConfiguration.Initialize();
Application.Run(new MainForm()); Application.Run(new MainForm());
} }