chore: partially document MainForm
This commit is contained in:
@@ -19,6 +19,7 @@ namespace CarManagerV3
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// Open the most recent file if it exists. Otherwise, use default filepath.
|
||||
List<string> recentFiles = SafeManager.GetRecentPaths();
|
||||
if(recentFiles.Count > 0)
|
||||
{
|
||||
@@ -33,6 +34,11 @@ namespace CarManagerV3
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the cars displayed in the flow layout panel.
|
||||
/// </summary>
|
||||
/// <param name="_cars">The cars.</param>
|
||||
/// <param name="updateGlobal">if set to <c>true</c> [update global].</param>
|
||||
private async void refreshCars(List<Car> _cars, bool updateGlobal = true)
|
||||
{
|
||||
|
||||
@@ -143,6 +149,13 @@ namespace CarManagerV3
|
||||
detailsForm.ShowDialog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Filters the cars by a search query.
|
||||
/// </summary>
|
||||
/// <param name="query">The search query.</param>
|
||||
/// <returns>
|
||||
/// A list of <see cref="Car"/> objects that match the query.
|
||||
/// </returns>
|
||||
List<Car> filterCarsByQuery(string query)
|
||||
{
|
||||
List<Car> results = new List<Car>();
|
||||
@@ -156,6 +169,10 @@ namespace CarManagerV3
|
||||
return results;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Searches the list of cars by a query and refreshes the display.
|
||||
/// </summary>
|
||||
/// <param name="query">The query.</param>
|
||||
void searchList(string query)
|
||||
{
|
||||
List<Car> results = filterCarsByQuery(query);
|
||||
@@ -327,11 +344,15 @@ namespace CarManagerV3
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Unbind and remove this.
|
||||
private void recentFilesToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Refreshes the recently opened files menu.
|
||||
/// </summary>
|
||||
private void refreshRecents()
|
||||
{
|
||||
recentFilesToolStripMenuItem.DropDownItems.Clear();
|
||||
|
||||
Reference in New Issue
Block a user