basic functionality done finally

This commit is contained in:
2023-03-27 22:13:40 +02:00
parent 6dd08d15b5
commit 35db2e56d4
4 changed files with 130 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
using System.Runtime.CompilerServices;
using System.Collections;
namespace Password_Manager
{
@@ -31,22 +31,23 @@ namespace Password_Manager
}
else
{
throw new InvalidOperationException("You cannot use this method if you instantiated the object using the parameterless constructor");
throw new InvalidOperationException("You cannot use the ReloadResults method if you instantiated the object using the parameterless constructor");
}
files = d.GetFiles("*.gpg");
} catch (ArgumentNullException e)
}
catch (ArgumentNullException e)
{
MessageBox.Show(e.ToString(), "Error: Invalid path", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
string[] arrayTmp = new string[files.Length];
for (int i = 0; i < arrayTmp.Length; i++)
List<string> elements = new List<string>();
for (int i = 0; i < files.Length; i++)
{
arrayTmp[i] = files[i].Name;
elements.Add(files[i].Name);
}
List<string> elements = new List<string>(arrayTmp);
string[] copy = elements.ToArray();
string? searchQuery = SearchQueryRequest?.Invoke();
if (searchQuery != null) //we have a search query
{
@@ -60,6 +61,7 @@ namespace Password_Manager
}
this.DataSource = elements;
SelectedIndex = 0;
}
}
}