Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Slight name refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Mar 14, 2024
1 parent db7b40a commit 5e6b1d7
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions ActiveDirectoryQuerier/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ private void LoadSavedQueriesFromFile()
_customQuery.LoadData();

// Loop through the queries and create a button for each one.
foreach (var newButton in _customQuery.Queries.Select(CreateCustomButton))
foreach (var newButton in _customQuery.Queries.Select(CreateQueryButtonInStackPanel))
{
// Lastly add the button to the stack panel
QueryButtonStackPanel.Add(newButton);
Expand Down Expand Up @@ -628,8 +628,7 @@ private void GetCurrentQuery()
string[] commandParameters;
string[] commandParameterValues;

if (SelectedCommandFromComboBoxInQueryBuilder is not null &&
SelectedCommandFromComboBoxInQueryBuilder.Parameters is not null)
if (SelectedCommandFromComboBoxInQueryBuilder?.Parameters != null)
{
commandParameters = new string[SelectedCommandFromComboBoxInQueryBuilder.Parameters.Count];
commandParameterValues = new string[SelectedCommandFromComboBoxInQueryBuilder.Parameters.Count];
Expand Down Expand Up @@ -705,7 +704,7 @@ private void SaveQuery(object commandParameter)

_customQuery.SerializeCommand(SelectedCommandFromComboBoxInQueryBuilder, QueryName, QueryDescription);

Button newButton = CreateCustomButton();
Button newButton = CreateQueryButtonInStackPanel();

QueryButtonStackPanel.Add(newButton);
}
Expand Down Expand Up @@ -744,13 +743,7 @@ private void ClearQueryBuilder(object _)
}
}

/// <summary>
/// This method is for creating buttons, right now it creates it off of the current/selectedcommand parameters but
/// could be changed to also do it from the query list.
/// </summary>
/// <returns>This method returns a button that has been customized for the custom query list</returns>
/// TODO: Change method name?
private Button CreateCustomButton(Query? query = null)
private Button CreateQueryButtonInStackPanel(Query? query = null)
{
Button newButton = new();

Expand Down

0 comments on commit 5e6b1d7

Please sign in to comment.